This document was built in Markdown in R 4.1.1 and compiled on 12 September 2021. It covers package lefko3 version 3.8.0. This is a long-format vignette, meaning that we have tried to include a good deal more code and output than is permissible in the standard CRAN-packaged vignette. Note, however, that code that results in dramatically long output has been hashtagged to prevent the inclusion of tens of pages of output that may confuse the user. In these cases, please remove the hashtag to see the output.
In this vignette, we use the cypdata and cypvert datasets to illustrate the estimation of raw MPMs and function-based MPMs. Please see the other vignettes included in package lefko3, as well as further vignettes posted online on the projects page of the Shefferson lab website, for further demonstrations of raw MPMs, function-based MPMs, IPMs, and age-by-stage MPMs.
The white lady’s slipper, Cypripedium candidum, is a North American perennial herb in the family Orchidaceae. It is long-lived and of conservation concern. This plant begins life by germinating from a dust seed, and then develops into a protocorm, which is a special subterranean life stage found in orchids and pyroloids. During this stage, the plant is non-photosynthetic and completely parasitic on its mycorrhizal fungi. It spends several years as a protocorm, and previous studies suggest that it typically spends 3 years before becoming a seedling. As a seedling, it may or may not produce aboveground sprouts, often remaining entirely subterranean and continuing its parasitic lifestyle. It may persist this way for many years before attaining adult size, at which point it may sprout with or without flowers, or may remain underground in a condition referred to as vegetative dormancy. The latter condition may continue for many years, with over a decade of continuous dormancy documented in the literature (Shefferson et al. 2018).
Figure 3L.1. Field work in the Cypripedium candidum habitat yielding the demographic data included with package lefko3. Photo courtesy of R. Shefferson.
The population from which the dataset originates is located within a wet meadow in a state nature preserve located in northeastern Illinois, USA (Figure 3L.1). The population was monitored annually from 2004 to 2009, with two monitoring sessions per year. Monitoring sessions took roughly 2 weeks each, and included complete censuses of the population divided into sections referred to as patches. Each monitoring session consisted of searches for previously recorded individuals, which were located according to coordinates relative to fixed stakes at the site, followed by a search for new individuals. Data recorded per individual included: the location, the number of non-flowering sprouts, the number of flowering sprouts, the number of flowers per flowering sprout, and the number of fruit pods per sprout (only in the second monitoring session per year, once fruiting had occurred). Location was used to infer individual identity. More information about this population and its characteristics is given in Shefferson et al. (2001) and Shefferson et al. (2017).
Our goal in this exercise will be to produce ahistorical and historical raw and function-based matrices for full comparison. We will assess the influence of history, and showcase the pros and cons of all four of these styles of MPMs. We will also illustrate the use of multiple demographic data formats via comparisons of the cypdata and cypvert datasets, which present the same information but in different input format. Where appropriate, we will provide commentary to illustrate where analyses may be shortened or altered for more typical analyses.
The horizontal dataset cypdata, and the ahistorical vertical dataset cypvert which is the same as cypdata but is structured differently, both include only data for the adult stages because the monitoring protocol did not include monitoring of juveniles. This is a result of the life history of these organisms, which includes substantial time belowground where individuals cannot be tracked and identified. Let’s begin by clearing the memory, loading the package, and loading the vertical and horizontal datasets.
rm(list=ls(all=TRUE))
library(lefko3)
data(cypdata)
data(cypvert)
The dataset cypdata is organized in horizontal format, meaning that rows correspond to unique individuals and columns correspond to stage in particular years. Looking at the original Excel spreadsheet (below), you will note a repeating pattern in the names of the columns. Package lefko3 includes functions to handle data in horizontal format, as well as functions to handle vertically formatted data (i.e. data for individuals is broken up across rows, where each row is a unique combination of individual and year in time t).
Figure 3L.2. Organization of the Cypripedium candidum horizontal dataset, as viewed in Microsoft Excel.
When we imported the dataset into R, we utilized this structure, and R handles the variables accordingly. We can see this in the summary for the dataset, as below (we also use dim() to calculate the dimensions of the dataset).
writeLines("Dimensions of dataset, in rows (data points) followed by columns (variables): ")
#> Dimensions of dataset, in rows (data points) followed by columns (variables):
dim(cypdata)
#> [1] 77 27
writeLines("\nSummary: ")
#>
#> Summary:
summary(cypdata)
#> plantid patch censor Inf2.04 Inf.04
#> Min. : 164.0 A:23 Min. :1 Min. :0 Min. :0.0000
#> 1st Qu.: 265.0 B:35 1st Qu.:1 1st Qu.:0 1st Qu.:0.0000
#> Median : 455.0 C:19 Median :1 Median :0 Median :0.0000
#> Mean : 669.1 Mean :1 Mean :0 Mean :0.6923
#> 3rd Qu.: 829.0 3rd Qu.:1 3rd Qu.:0 3rd Qu.:1.0000
#> Max. :1560.0 Max. :1 Max. :0 Max. :8.0000
#> NA's :12 NA's :12
#> Veg.04 Pod.04 Inf2.05 Inf.05
#> Min. : 0.000 Min. :0.0 Min. :0.00000 Min. : 0.000
#> 1st Qu.: 1.000 1st Qu.:0.0 1st Qu.:0.00000 1st Qu.: 0.000
#> Median : 2.000 Median :0.0 Median :0.00000 Median : 0.000
#> Mean : 2.923 Mean :0.2 Mean :0.04478 Mean : 1.537
#> 3rd Qu.: 4.000 3rd Qu.:0.0 3rd Qu.:0.00000 3rd Qu.: 2.000
#> Max. :12.000 Max. :3.0 Max. :1.00000 Max. :18.000
#> NA's :12 NA's :12 NA's :10 NA's :10
#> Veg.05 Pod.05 Inf2.06 Inf.06
#> Min. :0.000 Min. :0.0000 Min. :0 Min. : 0.0000
#> 1st Qu.:1.000 1st Qu.:0.0000 1st Qu.:0 1st Qu.: 0.0000
#> Median :1.000 Median :0.0000 Median :0 Median : 0.0000
#> Mean :2.134 Mean :0.6567 Mean :0 Mean : 0.9016
#> 3rd Qu.:3.000 3rd Qu.:1.0000 3rd Qu.:0 3rd Qu.: 1.0000
#> Max. :9.000 Max. :7.0000 Max. :0 Max. :18.0000
#> NA's :10 NA's :10 NA's :16 NA's :16
#> Veg.06 Pod.06 Inf2.07 Inf.07
#> Min. : 0.000 Min. :0.0000 Min. :0 Min. :0.0000
#> 1st Qu.: 1.000 1st Qu.:0.0000 1st Qu.:0 1st Qu.:0.0000
#> Median : 2.000 Median :0.0000 Median :0 Median :0.0000
#> Mean : 2.213 Mean :0.3934 Mean :0 Mean :0.6271
#> 3rd Qu.: 3.000 3rd Qu.:0.0000 3rd Qu.:0 3rd Qu.:1.0000
#> Max. :13.000 Max. :4.0000 Max. :0 Max. :7.0000
#> NA's :16 NA's :16 NA's :18
#> Veg.07 Pod.07 Inf2.08 Inf.08
#> Min. : 0.000 Min. :0.0000 Min. :0 Min. : 0.0000
#> 1st Qu.: 1.000 1st Qu.:0.0000 1st Qu.:0 1st Qu.: 0.0000
#> Median : 2.000 Median :0.0000 Median :0 Median : 0.0000
#> Mean : 2.627 Mean :0.0678 Mean :0 Mean : 0.8868
#> 3rd Qu.: 4.000 3rd Qu.:0.0000 3rd Qu.:0 3rd Qu.: 1.0000
#> Max. :13.000 Max. :1.0000 Max. :0 Max. :11.0000
#> NA's :18 NA's :18 NA's :24 NA's :24
#> Veg.08 Pod.08 Inf2.09 Inf.09
#> Min. : 0.00 Min. :0.0000 Min. :0 Min. : 0.000
#> 1st Qu.: 1.00 1st Qu.:0.0000 1st Qu.:0 1st Qu.: 0.000
#> Median : 2.00 Median :0.0000 Median :0 Median : 1.000
#> Mean : 2.83 Mean :0.1509 Mean :0 Mean : 1.833
#> 3rd Qu.: 4.00 3rd Qu.:0.0000 3rd Qu.:0 3rd Qu.: 2.000
#> Max. :13.00 Max. :2.0000 Max. :0 Max. :11.000
#> NA's :24 NA's :24 NA's :17 NA's :17
#> Veg.09 Pod.09
#> Min. : 0.000 Min. :0.000
#> 1st Qu.: 1.000 1st Qu.:0.000
#> Median : 1.000 Median :1.000
#> Mean : 2.233 Mean :1.133
#> 3rd Qu.: 3.000 3rd Qu.:1.000
#> Max. :10.000 Max. :8.000
#> NA's :17 NA's :17
In this dataset, there are 77 individuals, so there are 77 rows with data (not counting the header). There are 27 columns, which are the variables in the dataset. Note that the first 3 columns are variables giving identifying information about each individual, with each individual’s data entirely restricted to one row. This is followed by a number of sets of 4 columns, each named Inf2.XX, Inf.XX, Veg.XX, and Pod.XX. The XX in each case corresponds to a specific year, which are organized consecutively. Thus, columns 4-7 refer to year 04 (short for 2004), columns 8-11 refer to year 05, columns 12-15 refer to year 06, columns 16-19 refer to year 07, columns 20-23 refer to year 08, and columns 24-27 refer to year 09. Within each set of years, we see a repeating pattern of our 4 variables, which makes standardization easier later (although this repeating pattern is actually not required). To properly conduct this exercise, we need to know the exact number of years used, which is six years here (includes all years from 2004 to 2009).
Although this dataset is in horizontal structure, many demographers prefer to keep their data in a vertical structure. Data cypvert is essentially the same dataset as cypdata, but supplied in vertical structure. Let’s look at a screenshot of the Excel spreadsheet.
Figure 3L.3. Organization of the Cypripedium candidum vertical dataset, as viewed in Microsoft Excel.
We can see a number of differences from the horizontal dataset. One key difference is that each row includes not just identifying information for the individual, but also there is a column identifying the year that each datum was recorded. Here, the column year2 represents the monitoring occasion in time t. Some demographers include a single year of data per row, while others include two years in order to use the dataset directly in matrix estimation. Package lefko3 can handle all of these variations.
Here we view the vertical dataset’s dimensions and summary.
writeLines("Dimensions of dataset, in rows (data points) followed by columns (variables): ")
#> Dimensions of dataset, in rows (data points) followed by columns (variables):
dim(cypvert)
#> [1] 331 12
writeLines("\nSummary: ")
#>
#> Summary:
summary(cypvert)
#> plantid patch censor year2
#> Min. : 164.0 Length:331 Min. :1 Min. :2004
#> 1st Qu.: 391.0 Class :character 1st Qu.:1 1st Qu.:2005
#> Median : 454.0 Mode :character Median :1 Median :2006
#> Mean : 662.8 Mean :1 Mean :2006
#> 3rd Qu.: 664.0 3rd Qu.:1 3rd Qu.:2007
#> Max. :1560.0 Max. :1 Max. :2008
#>
#> Inf2.2 Inf.2 Veg.2 Pod.2
#> Min. :0.000000 Min. : 0.000 Min. : 0.000 Min. :0.0000
#> 1st Qu.:0.000000 1st Qu.: 0.000 1st Qu.: 1.000 1st Qu.:0.0000
#> Median :0.000000 Median : 0.000 Median : 2.000 Median :0.0000
#> Mean :0.009646 Mean : 0.941 Mean : 2.534 Mean :0.3049
#> 3rd Qu.:0.000000 3rd Qu.: 1.000 3rd Qu.: 3.000 3rd Qu.:0.0000
#> Max. :1.000000 Max. :18.000 Max. :13.000 Max. :7.0000
#> NA's :20 NA's :26 NA's :26 NA's :26
#> Inf2.3 Inf.3 Veg.3 Pod.3
#> Min. :0.000000 Min. : 0.000 Min. : 0.00 Min. :0.0000
#> 1st Qu.:0.000000 1st Qu.: 0.000 1st Qu.: 1.00 1st Qu.:0.0000
#> Median :0.000000 Median : 0.000 Median : 1.00 Median :0.0000
#> Mean :0.009804 Mean : 1.173 Mean : 2.39 Mean :0.4933
#> 3rd Qu.:0.000000 3rd Qu.: 1.000 3rd Qu.: 3.00 3rd Qu.:0.0000
#> Max. :1.000000 Max. :18.000 Max. :13.00 Max. :8.0000
#> NA's :25 NA's :31 NA's :31 NA's :31
This dataset is longer and narrower, with more rows and fewer columns. This is because we constructed the dataset by splitting the data for each individual across multiple rows. After three columns of identifying information (plantid, patch, and censor), a single column designates the time of occasion t, given as year2. This dataset then includes columns showing individual state in pairs of consecutive years corresponding to occasions t and t+1. State in occasion t-1 is not presented because this is an ahistorical dataset. This dataset includes the plantid variable, which is an individual identity term that allows us to associate rows with their individuals and so allows conversion.
Regardless of the approach used, each dataset must conform to some basic rules to make sure that R can properly process them. One important convention is that the name of each variable must appear only in the very first row of the spreadsheet, because name terms in rows below the first will likely change the variable definitions upon import. Another convention is that blank rows should be avoided, as these are typically interpreted as extra blank data points. The most important convention, however, is consistency of data type within variables. This generally means that variables should not include both numbers and text unless ALL entries are to be interpreted as text rather than true numbers. In essence, R interprets any variable with a single text entry as being purely text, and a variable cannot include a combination of true numbers and text. So, if you wish a variable to include true numbers for use in calculations, such as size measurements or binomial indicators of reproduction, then these variables must include ONLY NUMBERS and missing entries.
Before going further and standardizing our datasets, let’s consider the life history model(s) that we will be using.
Our first key decision is how to model the life history of the organism. We generally use the life cycle graph approach, and encourage its use as it simplifies the process of life history model development. The decision of the life history model, however, may be more complicated than simply diagramming the life cycle of the organism. Particularly, we must decide what life stages to include, how these life stages will be defined, and how these life stages are connected to one another via survival and fecundity transitions. These considerations will be strongly influenced by whether we wish to create a raw MPM or a function-based MPM.
It might be easiest to begin our discussion with consideration of the function-based MPM, and what sort of life history model works best if we choose this approach. With a function-based MPM (which includes the integral projection model, or IPM), there are really only two considerations that we need to be concerned about. First, what stages should be included based on a purely biological understanding of the organism’s life history? Some stages may never be monitored, and so these will have to be included but dealt with via proxy rates later. In our case, for example, we never monitored germinated seeds, protocorms, and seedlings, because it is essentially impossible to do so. We will include these stages in our life history model, but we will use proxy rates for their survival transitions, since we cannot use our dataset to estimate them. Second, what is the range of stages and/or sizes that actually occur in the dataset? This question is really focused on determining which survival and fecundity transitions we CAN estimate given our dataset. One key consideration here is to assess the complete range of sizes occurring within our dataset, since we do not wish to create stages in our life cycle model that go beyond the limits of what was actually observed (models that make predictions outside of the range of data they were parameterized with have a tendency to produce erroneous and at times egregiously strange predictions).
Let’s explore the range of sizes actually occurring in our dataset. There is no one variable that encapsulates the entire size of the individual in our dataset, so we will create a series of vectors that sums the numbers of sprouts that are single-flowered flowering, double-flowered flowering, and non-flowering, and use these sums as plant sizes. If we use the horizontal dataset for this purpose, then we get the following exploration.
size.04 <- cypdata$Inf2.04 + cypdata$Inf.04 + cypdata$Veg.04
size.05 <- cypdata$Inf2.05 + cypdata$Inf.05 + cypdata$Veg.05
size.06 <- cypdata$Inf2.06 + cypdata$Inf.06 + cypdata$Veg.06
size.07 <- cypdata$Inf2.07 + cypdata$Inf.07 + cypdata$Veg.07
size.08 <- cypdata$Inf2.08 + cypdata$Inf.08 + cypdata$Veg.08
size.09 <- cypdata$Inf2.09 + cypdata$Inf.09 + cypdata$Veg.09
summary(c(size.04, size.05, size.06, size.07, size.08, size.09))
#> Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
#> 1.000 1.000 2.000 3.581 5.000 24.000 97
The summary shows that the smallest recorded size is a single sprout, and the largest is 24 sprouts. The 97 NAs are a combination of vegetative dormancy and instances of individuals being dead or simply not alive (i.e. not yet born). Given this, we might utilize the following life history model for our function-based MPMs.
Figure 3L.4. Life history model of Cypripedium candidum for use in function-based MPMs.
We can see a variety of transitions within this figure. The juvenile stages have fairly simple transitions. New recruits may enter the population directly from germination of a seed produced the previous year, in which case they start in the protocorm 1 stage, or they may begin as dormant seed. Dormant seed may remain dormant, die, or germinate into the protocorm 1 stage. Protocorms exist for up to 3 years, yielding the protocorm 1, 2, and 3 stages, without any possibility of staying within each of these stages for more than a single year. Protocorm 3 leads to a seedling stage, in which the plant may persist for many years before becoming mature. Here, maturity does not really refer to reproduction per se, but rather to a morphology indistinguishable from a reproductive plant except for the lack of a flower. The first mature stage is usually either vegetative dormancy (dorm), during which time the plant does not sprout, or a small, non-flowering adult (1V). Once in this portion of the life history, the plant may transition among 49 mature stages, including vegetative dormancy, 1-24 shoots without flowers, or 1-24 shoots with at least one flower.
Now that we have our life history model, we will need to describe the life history characterizing the dataset, matching it to our analyses properly with a stageframe for our Cypripedium candidum dataset. This is a vitally important step, and most instances of errors occurring in the use of lefko3 originate from an inappropriate stageframe being used in an analysis. Since this analysis will be function-based, we will include all possible size classes here. If constructing raw matrices, all sizes that occur in the dataset need to be accounted for in a way that is both natural and parsimonious with respect to the numbers of individuals moving through actual transitions. If constructing function-based matrices, such as IPMs, then representative sizes at systematic increments will be satisfactory. Since size is count-based in the Cypripedium candidum case, we will use all numbers of stems that might occur from 0 to the maximum in the dataset, representing the life history diagram shown in the beginning of this chapter.
sizevector <- c(0, 0, 0, 0, 0, seq(from = 0, t = 24), seq(from = 1, to = 24))
stagevector <- c("SD", "P1", "P2", "P3", "SL", "D", "V1", "V2", "V3", "V4", "V5",
"V6", "V7", "V8", "V9", "V10", "V11", "V12", "V13", "V14", "V15", "V16", "V17",
"V18", "V19", "V20", "V21", "V22", "V23", "V24", "F1", "F2", "F3", "F4", "F5",
"F6", "F7", "F8", "F9", "F10", "F11", "F12", "F13", "F14", "F15", "F16", "F17",
"F18", "F19", "F20", "F21", "F22", "F23", "F24")
repvector <- c(0, 0, 0, 0, 0, rep(0, 25), rep(1, 24))
obsvector <- c(0, 0, 0, 0, 0, 0, rep(1, 48))
matvector <- c(0, 0, 0, 0, 0, rep(1, 49))
immvector <- c(0, 1, 1, 1, 1, rep(0, 49))
propvector <- c(1, rep(0, 53))
indataset <- c(0, 0, 0, 0, 0, rep(1, 49))
comments <- c("Dormant seed", "Yr1 protocorm", "Yr2 protocorm", "Yr3 protocorm",
"Seedling", "Veg dorm", "Veg adult 1 stem", "Veg adult 2 stems",
"Veg adult 3 stems", "Veg adult 4 stems", "Veg adult 5 stems",
"Veg adult 6 stems", "Veg adult 7 stems", "Veg adult 8 stems",
"Veg adult 9 stems", "Veg adult 10 stems", "Veg adult 11 stems",
"Veg adult 12 stems", "Veg adult 13 stems", "Veg adult 14 stems",
"Veg adult 15 stems", "Veg adult 16 stems", "Veg adult 17 stems",
"Veg adult 18 stems", "Veg adult 19 stems", "Veg adult 20 stems",
"Veg adult 21 stems", "Veg adult 22 stems", "Veg adult 23 stems",
"Veg adult 24 stems", "Flo adult 1 stem", "Flo adult 2 stems",
"Flo adult 3 stems", "Flo adult 4 stems", "Flo adult 5 stems",
"Flo adult 6 stems", "Flo adult 7 stems", "Flo adult 8 stems",
"Flo adult 9 stems", "Flo adult 10 stems", "Flo adult 11 stems",
"Flo adult 12 stems", "Flo adult 13 stems", "Flo adult 14 stems",
"Flo adult 15 stems", "Flo adult 16 stems", "Flo adult 17 stems",
"Flo adult 18 stems", "Flo adult 19 stems", "Flo adult 20 stems",
"Flo adult 21 stems", "Flo adult 22 stems", "Flo adult 23 stems",
"Flo adult 24 stems")
cypframe_fb <- sf_create(sizes = sizevector, stagenames = stagevector,
repstatus = repvector, obsstatus = obsvector, matstatus = matvector,
propstatus = propvector, immstatus = immvector, indataset = indataset,
comments = comments)
cypframe_fb
#> stage size repstatus obsstatus propstatus immstatus matstatus indataset
#> 1 SD 0 0 0 1 0 0 0
#> 2 P1 0 0 0 0 1 0 0
#> 3 P2 0 0 0 0 1 0 0
#> 4 P3 0 0 0 0 1 0 0
#> 5 SL 0 0 0 0 1 0 0
#> 6 D 0 0 0 0 0 1 1
#> 7 V1 1 0 1 0 0 1 1
#> 8 V2 2 0 1 0 0 1 1
#> 9 V3 3 0 1 0 0 1 1
#> 10 V4 4 0 1 0 0 1 1
#> 11 V5 5 0 1 0 0 1 1
#> 12 V6 6 0 1 0 0 1 1
#> 13 V7 7 0 1 0 0 1 1
#> 14 V8 8 0 1 0 0 1 1
#> 15 V9 9 0 1 0 0 1 1
#> 16 V10 10 0 1 0 0 1 1
#> 17 V11 11 0 1 0 0 1 1
#> 18 V12 12 0 1 0 0 1 1
#> 19 V13 13 0 1 0 0 1 1
#> 20 V14 14 0 1 0 0 1 1
#> 21 V15 15 0 1 0 0 1 1
#> 22 V16 16 0 1 0 0 1 1
#> 23 V17 17 0 1 0 0 1 1
#> 24 V18 18 0 1 0 0 1 1
#> 25 V19 19 0 1 0 0 1 1
#> 26 V20 20 0 1 0 0 1 1
#> 27 V21 21 0 1 0 0 1 1
#> 28 V22 22 0 1 0 0 1 1
#> 29 V23 23 0 1 0 0 1 1
#> 30 V24 24 0 1 0 0 1 1
#> 31 F1 1 1 1 0 0 1 1
#> 32 F2 2 1 1 0 0 1 1
#> 33 F3 3 1 1 0 0 1 1
#> 34 F4 4 1 1 0 0 1 1
#> 35 F5 5 1 1 0 0 1 1
#> 36 F6 6 1 1 0 0 1 1
#> 37 F7 7 1 1 0 0 1 1
#> 38 F8 8 1 1 0 0 1 1
#> 39 F9 9 1 1 0 0 1 1
#> 40 F10 10 1 1 0 0 1 1
#> 41 F11 11 1 1 0 0 1 1
#> 42 F12 12 1 1 0 0 1 1
#> 43 F13 13 1 1 0 0 1 1
#> 44 F14 14 1 1 0 0 1 1
#> 45 F15 15 1 1 0 0 1 1
#> 46 F16 16 1 1 0 0 1 1
#> 47 F17 17 1 1 0 0 1 1
#> 48 F18 18 1 1 0 0 1 1
#> 49 F19 19 1 1 0 0 1 1
#> 50 F20 20 1 1 0 0 1 1
#> 51 F21 21 1 1 0 0 1 1
#> 52 F22 22 1 1 0 0 1 1
#> 53 F23 23 1 1 0 0 1 1
#> 54 F24 24 1 1 0 0 1 1
#> binhalfwidth_raw min_age max_age sizebin_min sizebin_max sizebin_center
#> 1 0.5 NA NA -0.5 0.5 0
#> 2 0.5 NA NA -0.5 0.5 0
#> 3 0.5 NA NA -0.5 0.5 0
#> 4 0.5 NA NA -0.5 0.5 0
#> 5 0.5 NA NA -0.5 0.5 0
#> 6 0.5 NA NA -0.5 0.5 0
#> 7 0.5 NA NA 0.5 1.5 1
#> 8 0.5 NA NA 1.5 2.5 2
#> 9 0.5 NA NA 2.5 3.5 3
#> 10 0.5 NA NA 3.5 4.5 4
#> 11 0.5 NA NA 4.5 5.5 5
#> 12 0.5 NA NA 5.5 6.5 6
#> 13 0.5 NA NA 6.5 7.5 7
#> 14 0.5 NA NA 7.5 8.5 8
#> 15 0.5 NA NA 8.5 9.5 9
#> 16 0.5 NA NA 9.5 10.5 10
#> 17 0.5 NA NA 10.5 11.5 11
#> 18 0.5 NA NA 11.5 12.5 12
#> 19 0.5 NA NA 12.5 13.5 13
#> 20 0.5 NA NA 13.5 14.5 14
#> 21 0.5 NA NA 14.5 15.5 15
#> 22 0.5 NA NA 15.5 16.5 16
#> 23 0.5 NA NA 16.5 17.5 17
#> 24 0.5 NA NA 17.5 18.5 18
#> 25 0.5 NA NA 18.5 19.5 19
#> 26 0.5 NA NA 19.5 20.5 20
#> 27 0.5 NA NA 20.5 21.5 21
#> 28 0.5 NA NA 21.5 22.5 22
#> 29 0.5 NA NA 22.5 23.5 23
#> 30 0.5 NA NA 23.5 24.5 24
#> 31 0.5 NA NA 0.5 1.5 1
#> 32 0.5 NA NA 1.5 2.5 2
#> 33 0.5 NA NA 2.5 3.5 3
#> 34 0.5 NA NA 3.5 4.5 4
#> 35 0.5 NA NA 4.5 5.5 5
#> 36 0.5 NA NA 5.5 6.5 6
#> 37 0.5 NA NA 6.5 7.5 7
#> 38 0.5 NA NA 7.5 8.5 8
#> 39 0.5 NA NA 8.5 9.5 9
#> 40 0.5 NA NA 9.5 10.5 10
#> 41 0.5 NA NA 10.5 11.5 11
#> 42 0.5 NA NA 11.5 12.5 12
#> 43 0.5 NA NA 12.5 13.5 13
#> 44 0.5 NA NA 13.5 14.5 14
#> 45 0.5 NA NA 14.5 15.5 15
#> 46 0.5 NA NA 15.5 16.5 16
#> 47 0.5 NA NA 16.5 17.5 17
#> 48 0.5 NA NA 17.5 18.5 18
#> 49 0.5 NA NA 18.5 19.5 19
#> 50 0.5 NA NA 19.5 20.5 20
#> 51 0.5 NA NA 20.5 21.5 21
#> 52 0.5 NA NA 21.5 22.5 22
#> 53 0.5 NA NA 22.5 23.5 23
#> 54 0.5 NA NA 23.5 24.5 24
#> sizebin_width comments
#> 1 1 Dormant seed
#> 2 1 Yr1 protocorm
#> 3 1 Yr2 protocorm
#> 4 1 Yr3 protocorm
#> 5 1 Seedling
#> 6 1 Veg dorm
#> 7 1 Veg adult 1 stem
#> 8 1 Veg adult 2 stems
#> 9 1 Veg adult 3 stems
#> 10 1 Veg adult 4 stems
#> 11 1 Veg adult 5 stems
#> 12 1 Veg adult 6 stems
#> 13 1 Veg adult 7 stems
#> 14 1 Veg adult 8 stems
#> 15 1 Veg adult 9 stems
#> 16 1 Veg adult 10 stems
#> 17 1 Veg adult 11 stems
#> 18 1 Veg adult 12 stems
#> 19 1 Veg adult 13 stems
#> 20 1 Veg adult 14 stems
#> 21 1 Veg adult 15 stems
#> 22 1 Veg adult 16 stems
#> 23 1 Veg adult 17 stems
#> 24 1 Veg adult 18 stems
#> 25 1 Veg adult 19 stems
#> 26 1 Veg adult 20 stems
#> 27 1 Veg adult 21 stems
#> 28 1 Veg adult 22 stems
#> 29 1 Veg adult 23 stems
#> 30 1 Veg adult 24 stems
#> 31 1 Flo adult 1 stem
#> 32 1 Flo adult 2 stems
#> 33 1 Flo adult 3 stems
#> 34 1 Flo adult 4 stems
#> 35 1 Flo adult 5 stems
#> 36 1 Flo adult 6 stems
#> 37 1 Flo adult 7 stems
#> 38 1 Flo adult 8 stems
#> 39 1 Flo adult 9 stems
#> 40 1 Flo adult 10 stems
#> 41 1 Flo adult 11 stems
#> 42 1 Flo adult 12 stems
#> 43 1 Flo adult 13 stems
#> 44 1 Flo adult 14 stems
#> 45 1 Flo adult 15 stems
#> 46 1 Flo adult 16 stems
#> 47 1 Flo adult 17 stems
#> 48 1 Flo adult 18 stems
#> 49 1 Flo adult 19 stems
#> 50 1 Flo adult 20 stems
#> 51 1 Flo adult 21 stems
#> 52 1 Flo adult 22 stems
#> 53 1 Flo adult 23 stems
#> 54 1 Flo adult 24 stems
A close look at the resulting object, cypframe, shows a data frame that includes the following information in order for each stage: the stage’s name, the associated size, its reproductive status, its status as an observable stage, its status as a propagule stage, its status as an immature stage, its status as a mature stage, whether it occurs in the dataset, the half-width of its size class bin, the minimum and maximum ages associated with the stage, the minimum and maximum of its size class bin, the centroid of its size class bin (currently the arithmetic mean), its full size class bin width, and a comments field describing the stage. Stage names and combinations of characteristics must be unique to prevent estimation errors, and the comments field may be edited to include any information deemed pertinent.
How does the life history model differ if we wish to develop a raw MPM? The key difference is that we need to consider how large our dataset is, and to create only as many stages as can be routinely transitioned to and from based on the data. The life history model above in Fig. 3L.4, for example, is not useable for raw MPMs because we have cut the size bins too finely - it is likely that in a typical year, only some of these stages will have individuals actually transitioning between them. The impact of this is that we will end up with many 0s for transitions that, in a sufficiently large population, should not equal 0.
To deal with this problem, we need to explore the dataset to determine a reasonable number of life history stages and on where the breaks should occur between these stages. A number of means exist to do this, and users should see Caswell (2001) and Kendall et al. (2019) for good discussions of the topic. Here, we suggest plotting a size distribution and assessing a series of numbers of natural breaks using the Jenks natural breaks algorithm (Jenks 1967), or another such algorithm. Let’s take a look at a distribution plot of size.
plot(density(c(size.04, size.05, size.06, size.07, size.08, size.09), na.rm = TRUE),
main = "", xlab = "Size (# of sprouts)", bty = "n")
Figure 3L.5. Distribution of size in Cypripedium candidum
We can see here that most individuals are small, and so our size data is densest around 1-2 sprouts or so. Large individuals are rare, so we will need to make size bins larger for big plants than for small plants. Let’s try finding some natural breaks with the Jenks algorithm, separating into 3, 4, 5, and 6 stages. To separate the size data into these numbers of stages stages, we need to identify a total of 4, 5, 6, and 7 breaks including the minimum and maximum. Please make sure that you have installed the BAMMtools package for this to work properly.
BAMMtools::getJenksBreaks(c(size.04, size.05, size.06, size.07, size.08, size.09),
k = 4)
#> [1] 1 4 11 24
BAMMtools::getJenksBreaks(c(size.04, size.05, size.06, size.07, size.08, size.09),
k = 5)
#> [1] 1 3 7 14 24
BAMMtools::getJenksBreaks(c(size.04, size.05, size.06, size.07, size.08, size.09),
k = 6)
#> [1] 1 2 5 8 15 24
BAMMtools::getJenksBreaks(c(size.04, size.05, size.06, size.07, size.08, size.09),
k = 7)
#> [1] 1 2 4 7 11 16 24
The Jenks method gives us the borders of the size classes under different numbers of stages. So, a 3 stage model has the first stage include 1-3 sprouts, the second stage include 3-10 sprouts, and the 3rd stage include 11-24 sprouts. Given what we know about the size distribution, we will try to separate the data into 5 stages (1 sprout, 2-4 sprouts, 5-7 sprouts, 8-14 sprouts, and 15-24 sprouts), which would result in 11 total life history stages in our like history (1 dormant seed, 3 protocorms, 1 seedling, 1 vegatative dormant stage, and 5 size-classified adult stages).
Let’s now build a stageframe using these breaks.
sizevector <- c(0, 0, 0, 0, 0, 0, 1, 3, 6, 11, 19.5)
stagevector <- c("SD", "P1", "P2", "P3", "SL", "D", "XSm", "Sm", "Md", "Lg",
"XLg")
repvector <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1)
obsvector <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1)
matvector <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1)
immvector <- c(0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0)
propvector <- c(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
indataset <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1)
binvec <- c(0, 0, 0, 0, 0, 0.5, 0.5, 1.5, 1.5, 3.5, 5)
comments <- c("Dormant seed", "1st yr protocorm", "2nd yr protocorm",
"3rd yr protocorm", "Seedling", "Dormant adult",
"Extra small adult (1 shoot)", "Small adult (2-4 shoots)",
"Medium adult (5-7 shoots)", "Large adult (8-14 shoots)",
"Extra large adult (>14 shoots)")
cypframe_raw <- sf_create(sizes = sizevector, stagenames = stagevector,
repstatus = repvector, obsstatus = obsvector, matstatus = matvector,
propstatus = propvector, immstatus = immvector, indataset = indataset,
binhalfwidth = binvec, comments = comments)
cypframe_raw
#> stage size repstatus obsstatus propstatus immstatus matstatus indataset
#> 1 SD 0.0 0 0 1 0 0 0
#> 2 P1 0.0 0 0 0 1 0 0
#> 3 P2 0.0 0 0 0 1 0 0
#> 4 P3 0.0 0 0 0 1 0 0
#> 5 SL 0.0 0 0 0 1 0 0
#> 6 D 0.0 0 0 0 0 1 1
#> 7 XSm 1.0 1 1 0 0 1 1
#> 8 Sm 3.0 1 1 0 0 1 1
#> 9 Md 6.0 1 1 0 0 1 1
#> 10 Lg 11.0 1 1 0 0 1 1
#> 11 XLg 19.5 1 1 0 0 1 1
#> binhalfwidth_raw min_age max_age sizebin_min sizebin_max sizebin_center
#> 1 0.0 NA NA 0.0 0.0 0.0
#> 2 0.0 NA NA 0.0 0.0 0.0
#> 3 0.0 NA NA 0.0 0.0 0.0
#> 4 0.0 NA NA 0.0 0.0 0.0
#> 5 0.0 NA NA 0.0 0.0 0.0
#> 6 0.5 NA NA -0.5 0.5 0.0
#> 7 0.5 NA NA 0.5 1.5 1.0
#> 8 1.5 NA NA 1.5 4.5 3.0
#> 9 1.5 NA NA 4.5 7.5 6.0
#> 10 3.5 NA NA 7.5 14.5 11.0
#> 11 5.0 NA NA 14.5 24.5 19.5
#> sizebin_width comments
#> 1 0 Dormant seed
#> 2 0 1st yr protocorm
#> 3 0 2nd yr protocorm
#> 4 0 3rd yr protocorm
#> 5 0 Seedling
#> 6 1 Dormant adult
#> 7 1 Extra small adult (1 shoot)
#> 8 3 Small adult (2-4 shoots)
#> 9 3 Medium adult (5-7 shoots)
#> 10 7 Large adult (8-14 shoots)
#> 11 10 Extra large adult (>14 shoots)
The life history model corresponding to this stageframe is different than in the previous case, primarily in that it has fewer adult stages. Further, all adult stages are now treated as reproductive in order to minimize the possibility that some transitions will equal 0 simply from a lack of data (in contrast, we can separate reproductive and non-reproductive stages in the function-based case). Here is our new life history model:
Figure 3L.6. Life history model of Cypripedium candidum for use in raw-based MPMs.
Now that we have our life history models for our raw MPM and function-based MPM analyses, we can create our standardized datasets. We will standardize these datasets using our stageframes, and so we need to create two standardized datasets - one for the raw MPM and another for the function-based MPM. Let’s first standardize the vertical dataset for the raw MPM. For this purpose, we will utilize the verticalize3() function. Because we are lumping reproductive and non-reproductive individuals into the non-dormant adult classes, we need to set NRasRep = TRUE. Otherwise, verticalize3() will attempt to use the reproductive status of individuals in classification, and will fail due to the presence of non-reproductive adults. We also need to set NAas0 = TRUE to make sure that NA values in size are turned into 0 entries where necessary, and so aid in the assignment of the vegetative dormancy stage. Finally, note that we set up three different size variables here, not as sizea, sizeb, and sizec, and that we tell R that we want overall size to be the sum of these (stagesize = "sizeadded").
cypraw_v1 <- verticalize3(data = cypdata, noyears = 6, firstyear = 2004,
patchidcol = "patch", individcol = "plantid", blocksize = 4,
sizeacol = "Inf2.04", sizebcol = "Inf.04", sizeccol = "Veg.04",
repstracol = "Inf.04", repstrbcol = "Inf2.04", fecacol = "Pod.04",
stageassign = cypframe_raw, stagesize = "sizeadded", NAas0 = TRUE,
NRasRep = TRUE)
head(cypraw_v1)
#> rowid popid patchid individ year2 firstseen lastseen obsage obslifespan
#> 1 1 A 164 2004 2004 2004 0 0
#> 2 2 A 165 2004 2004 2009 0 5
#> 3 3 A 240 2004 2004 2005 0 1
#> 4 4 A 242 2004 2004 2009 0 5
#> 5 5 A 243 2004 2004 2009 0 5
#> 6 6 A 246 2004 2004 2007 0 3
#> sizea1 sizeb1 sizec1 size1added repstra1 repstrb1 feca1 juvgiven1 obsstatus1
#> 1 0 0 0 0 0 0 0 0 0
#> 2 0 0 0 0 0 0 0 0 0
#> 3 0 0 0 0 0 0 0 0 0
#> 4 0 0 0 0 0 0 0 0 0
#> 5 0 0 0 0 0 0 0 0 0
#> 6 0 0 0 0 0 0 0 0 0
#> repstatus1 fecstatus1 matstatus1 alive1 stage1 stage1index sizea2 sizeb2
#> 1 0 0 0 0 NotAlive 0 0 0
#> 2 0 0 0 0 NotAlive 0 0 2
#> 3 0 0 0 0 NotAlive 0 0 1
#> 4 0 0 0 0 NotAlive 0 0 0
#> 5 0 0 0 0 NotAlive 0 0 0
#> 6 0 0 0 0 NotAlive 0 0 0
#> sizec2 size2added repstra2 repstrb2 feca2 juvgiven2 obsstatus2 repstatus2
#> 1 1 1 0 0 0 0 1 0
#> 2 1 3 2 0 1 0 1 1
#> 3 0 1 1 0 0 0 1 1
#> 4 1 1 0 0 0 0 1 0
#> 5 5 5 0 0 0 0 1 0
#> 6 1 1 0 0 0 0 1 0
#> fecstatus2 matstatus2 alive2 stage2 stage2index sizea3 sizeb3 sizec3
#> 1 0 1 1 XSm 7 0 0 0
#> 2 1 1 1 Sm 8 0 2 0
#> 3 0 1 1 XSm 7 0 0 1
#> 4 0 1 1 XSm 7 0 0 1
#> 5 0 1 1 Md 9 0 0 2
#> 6 0 1 1 XSm 7 0 0 1
#> size3added repstra3 repstrb3 feca3 juvgiven3 obsstatus3 repstatus3 fecstatus3
#> 1 0 0 0 0 0 0 0 0
#> 2 2 2 0 0 0 1 1 0
#> 3 1 0 0 0 0 1 0 0
#> 4 1 0 0 0 0 1 0 0
#> 5 2 0 0 0 0 1 0 0
#> 6 1 0 0 0 0 1 0 0
#> matstatus3 alive3 stage3 stage3index
#> 1 1 0 NotAlive 0
#> 2 1 1 Sm 8
#> 3 1 1 XSm 7
#> 4 1 1 XSm 7
#> 5 1 1 Sm 8
#> 6 1 1 XSm 7
In the code above, we used the head() function to take a look at the first 6 rows of the standardized data frame. The variable names and formats work with all functions in lefko3, and of course this data frame may be used in other packages, as well. Let’s now take a look at a summary of the full data frame.
summary(cypraw_v1)
#> rowid popid patchid individ year2
#> Min. : 1.00 :320 A: 93 Length:320 Min. :2004
#> 1st Qu.:21.00 B:154 Class :character 1st Qu.:2005
#> Median :37.50 C: 73 Mode :character Median :2006
#> Mean :38.45 Mean :2006
#> 3rd Qu.:56.00 3rd Qu.:2007
#> Max. :77.00 Max. :2008
#> firstseen lastseen obsage obslifespan
#> Min. :2004 Min. :2004 Min. :0.000 Min. :0.000
#> 1st Qu.:2004 1st Qu.:2009 1st Qu.:1.000 1st Qu.:5.000
#> Median :2004 Median :2009 Median :2.000 Median :5.000
#> Mean :2004 Mean :2009 Mean :1.853 Mean :4.556
#> 3rd Qu.:2004 3rd Qu.:2009 3rd Qu.:3.000 3rd Qu.:5.000
#> Max. :2008 Max. :2009 Max. :4.000 Max. :5.000
#> sizea1 sizeb1 sizec1 size1added
#> Min. :0.000000 Min. : 0.0000 Min. : 0.0 Min. : 0.000
#> 1st Qu.:0.000000 1st Qu.: 0.0000 1st Qu.: 0.0 1st Qu.: 0.000
#> Median :0.000000 Median : 0.0000 Median : 1.0 Median : 2.000
#> Mean :0.009375 Mean : 0.7469 Mean : 1.9 Mean : 2.656
#> 3rd Qu.:0.000000 3rd Qu.: 1.0000 3rd Qu.: 3.0 3rd Qu.: 4.000
#> Max. :1.000000 Max. :18.0000 Max. :13.0 Max. :21.000
#> repstra1 repstrb1 feca1 juvgiven1
#> Min. : 0.0000 Min. :0.000000 Min. :0.0000 Min. :0
#> 1st Qu.: 0.0000 1st Qu.:0.000000 1st Qu.:0.0000 1st Qu.:0
#> Median : 0.0000 Median :0.000000 Median :0.0000 Median :0
#> Mean : 0.7469 Mean :0.009375 Mean :0.2656 Mean :0
#> 3rd Qu.: 1.0000 3rd Qu.:0.000000 3rd Qu.:0.0000 3rd Qu.:0
#> Max. :18.0000 Max. :1.000000 Max. :7.0000 Max. :0
#> obsstatus1 repstatus1 fecstatus1 matstatus1
#> Min. :0.0000 Min. :0.0000 Min. :0.0000 Min. :0.0000
#> 1st Qu.:0.0000 1st Qu.:0.0000 1st Qu.:0.0000 1st Qu.:1.0000
#> Median :1.0000 Median :0.0000 Median :0.0000 Median :1.0000
#> Mean :0.7469 Mean :0.2875 Mean :0.1344 Mean :0.7688
#> 3rd Qu.:1.0000 3rd Qu.:1.0000 3rd Qu.:0.0000 3rd Qu.:1.0000
#> Max. :1.0000 Max. :1.0000 Max. :1.0000 Max. :1.0000
#> alive1 stage1 stage1index sizea2
#> Min. :0.0000 Length:320 Min. : 0.000 Min. :0.000000
#> 1st Qu.:1.0000 Class :character 1st Qu.: 6.000 1st Qu.:0.000000
#> Median :1.0000 Mode :character Median : 8.000 Median :0.000000
#> Mean :0.7688 Mean : 6.144 Mean :0.009375
#> 3rd Qu.:1.0000 3rd Qu.: 8.000 3rd Qu.:0.000000
#> Max. :1.0000 Max. :11.000 Max. :1.000000
#> sizeb2 sizec2 size2added repstra2
#> Min. : 0.0000 Min. : 0.000 Min. : 0.000 Min. : 0.0000
#> 1st Qu.: 0.0000 1st Qu.: 1.000 1st Qu.: 1.000 1st Qu.: 0.0000
#> Median : 0.0000 Median : 2.000 Median : 2.000 Median : 0.0000
#> Mean : 0.8969 Mean : 2.416 Mean : 3.322 Mean : 0.8969
#> 3rd Qu.: 1.0000 3rd Qu.: 3.000 3rd Qu.: 4.000 3rd Qu.: 1.0000
#> Max. :18.0000 Max. :13.000 Max. :24.000 Max. :18.0000
#> repstrb2 feca2 juvgiven2 obsstatus2
#> Min. :0.000000 Min. :0.0000 Min. :0 Min. :0.0000
#> 1st Qu.:0.000000 1st Qu.:0.0000 1st Qu.:0 1st Qu.:1.0000
#> Median :0.000000 Median :0.0000 Median :0 Median :1.0000
#> Mean :0.009375 Mean :0.2906 Mean :0 Mean :0.9531
#> 3rd Qu.:0.000000 3rd Qu.:0.0000 3rd Qu.:0 3rd Qu.:1.0000
#> Max. :1.000000 Max. :7.0000 Max. :0 Max. :1.0000
#> repstatus2 fecstatus2 matstatus2 alive2 stage2
#> Min. :0.0000 Min. :0.0000 Min. :1 Min. :1 Length:320
#> 1st Qu.:0.0000 1st Qu.:0.0000 1st Qu.:1 1st Qu.:1 Class :character
#> Median :0.0000 Median :0.0000 Median :1 Median :1 Mode :character
#> Mean :0.3688 Mean :0.1562 Mean :1 Mean :1
#> 3rd Qu.:1.0000 3rd Qu.:0.0000 3rd Qu.:1 3rd Qu.:1
#> Max. :1.0000 Max. :1.0000 Max. :1 Max. :1
#> stage2index sizea3 sizeb3 sizec3
#> Min. : 6.000 Min. :0.000000 Min. : 0.000 Min. : 0.000
#> 1st Qu.: 7.000 1st Qu.:0.000000 1st Qu.: 0.000 1st Qu.: 1.000
#> Median : 8.000 Median :0.000000 Median : 0.000 Median : 1.000
#> Mean : 7.919 Mean :0.009375 Mean : 1.069 Mean : 2.209
#> 3rd Qu.: 8.000 3rd Qu.:0.000000 3rd Qu.: 1.000 3rd Qu.: 3.000
#> Max. :11.000 Max. :1.000000 Max. :18.000 Max. :13.000
#> size3added repstra3 repstrb3 feca3
#> Min. : 0.000 Min. : 0.000 Min. :0.000000 Min. :0.0000
#> 1st Qu.: 1.000 1st Qu.: 0.000 1st Qu.:0.000000 1st Qu.:0.0000
#> Median : 2.000 Median : 0.000 Median :0.000000 Median :0.0000
#> Mean : 3.288 Mean : 1.069 Mean :0.009375 Mean :0.4562
#> 3rd Qu.: 4.000 3rd Qu.: 1.000 3rd Qu.:0.000000 3rd Qu.:0.0000
#> Max. :24.000 Max. :18.000 Max. :1.000000 Max. :8.0000
#> juvgiven3 obsstatus3 repstatus3 fecstatus3 matstatus3
#> Min. :0 Min. :0.0 Min. :0.0 Min. :0.0000 Min. :1
#> 1st Qu.:0 1st Qu.:1.0 1st Qu.:0.0 1st Qu.:0.0000 1st Qu.:1
#> Median :0 Median :1.0 Median :0.0 Median :0.0000 Median :1
#> Mean :0 Mean :0.9 Mean :0.4 Mean :0.2219 Mean :1
#> 3rd Qu.:0 3rd Qu.:1.0 3rd Qu.:1.0 3rd Qu.:0.0000 3rd Qu.:1
#> Max. :0 Max. :1.0 Max. :1.0 Max. :1.0000 Max. :1
#> alive3 stage3 stage3index
#> Min. :0.0000 Length:320 Min. : 0.000
#> 1st Qu.:1.0000 Class :character 1st Qu.: 7.000
#> Median :1.0000 Mode :character Median : 8.000
#> Mean :0.9469 Mean : 7.544
#> 3rd Qu.:1.0000 3rd Qu.: 8.000
#> Max. :1.0000 Max. :11.000
Let’s also create our standardized data for the function-based MPM, as below. Remember that some of the settings need to change here, primarily because we are now going to separate adults not just by size but by reproductive status. So, we will NOT set NRasRep = TRUE here (the default is NRasRep = FALSE).
cypfb_v1 <- verticalize3(data = cypdata, noyears = 6, firstyear = 2004,
patchidcol = "patch", individcol = "plantid", blocksize = 4,
sizeacol = "Inf2.04", sizebcol = "Inf.04", sizeccol = "Veg.04",
repstracol = "Inf.04", repstrbcol = "Inf2.04", fecacol = "Pod.04",
stageassign = cypframe_fb, stagesize = "sizeadded", NAas0 = TRUE)
summary(cypfb_v1)
#> rowid popid patchid individ year2
#> Min. : 1.00 :320 A: 93 Length:320 Min. :2004
#> 1st Qu.:21.00 B:154 Class :character 1st Qu.:2005
#> Median :37.50 C: 73 Mode :character Median :2006
#> Mean :38.45 Mean :2006
#> 3rd Qu.:56.00 3rd Qu.:2007
#> Max. :77.00 Max. :2008
#> firstseen lastseen obsage obslifespan
#> Min. :2004 Min. :2004 Min. :0.000 Min. :0.000
#> 1st Qu.:2004 1st Qu.:2009 1st Qu.:1.000 1st Qu.:5.000
#> Median :2004 Median :2009 Median :2.000 Median :5.000
#> Mean :2004 Mean :2009 Mean :1.853 Mean :4.556
#> 3rd Qu.:2004 3rd Qu.:2009 3rd Qu.:3.000 3rd Qu.:5.000
#> Max. :2008 Max. :2009 Max. :4.000 Max. :5.000
#> sizea1 sizeb1 sizec1 size1added
#> Min. :0.000000 Min. : 0.0000 Min. : 0.0 Min. : 0.000
#> 1st Qu.:0.000000 1st Qu.: 0.0000 1st Qu.: 0.0 1st Qu.: 0.000
#> Median :0.000000 Median : 0.0000 Median : 1.0 Median : 2.000
#> Mean :0.009375 Mean : 0.7469 Mean : 1.9 Mean : 2.656
#> 3rd Qu.:0.000000 3rd Qu.: 1.0000 3rd Qu.: 3.0 3rd Qu.: 4.000
#> Max. :1.000000 Max. :18.0000 Max. :13.0 Max. :21.000
#> repstra1 repstrb1 feca1 juvgiven1
#> Min. : 0.0000 Min. :0.000000 Min. :0.0000 Min. :0
#> 1st Qu.: 0.0000 1st Qu.:0.000000 1st Qu.:0.0000 1st Qu.:0
#> Median : 0.0000 Median :0.000000 Median :0.0000 Median :0
#> Mean : 0.7469 Mean :0.009375 Mean :0.2656 Mean :0
#> 3rd Qu.: 1.0000 3rd Qu.:0.000000 3rd Qu.:0.0000 3rd Qu.:0
#> Max. :18.0000 Max. :1.000000 Max. :7.0000 Max. :0
#> obsstatus1 repstatus1 fecstatus1 matstatus1
#> Min. :0.0000 Min. :0.0000 Min. :0.0000 Min. :0.0000
#> 1st Qu.:0.0000 1st Qu.:0.0000 1st Qu.:0.0000 1st Qu.:1.0000
#> Median :1.0000 Median :0.0000 Median :0.0000 Median :1.0000
#> Mean :0.7469 Mean :0.2875 Mean :0.1344 Mean :0.7688
#> 3rd Qu.:1.0000 3rd Qu.:1.0000 3rd Qu.:0.0000 3rd Qu.:1.0000
#> Max. :1.0000 Max. :1.0000 Max. :1.0000 Max. :1.0000
#> alive1 stage1 stage1index sizea2
#> Min. :0.0000 Length:320 Min. : 0.00 Min. :0.000000
#> 1st Qu.:1.0000 Class :character 1st Qu.: 6.00 1st Qu.:0.000000
#> Median :1.0000 Mode :character Median : 8.00 Median :0.000000
#> Mean :0.7688 Mean :14.17 Mean :0.009375
#> 3rd Qu.:1.0000 3rd Qu.:31.00 3rd Qu.:0.000000
#> Max. :1.0000 Max. :51.00 Max. :1.000000
#> sizeb2 sizec2 size2added repstra2
#> Min. : 0.0000 Min. : 0.000 Min. : 0.000 Min. : 0.0000
#> 1st Qu.: 0.0000 1st Qu.: 1.000 1st Qu.: 1.000 1st Qu.: 0.0000
#> Median : 0.0000 Median : 2.000 Median : 2.000 Median : 0.0000
#> Mean : 0.8969 Mean : 2.416 Mean : 3.322 Mean : 0.8969
#> 3rd Qu.: 1.0000 3rd Qu.: 3.000 3rd Qu.: 4.000 3rd Qu.: 1.0000
#> Max. :18.0000 Max. :13.000 Max. :24.000 Max. :18.0000
#> repstrb2 feca2 juvgiven2 obsstatus2
#> Min. :0.000000 Min. :0.0000 Min. :0 Min. :0.0000
#> 1st Qu.:0.000000 1st Qu.:0.0000 1st Qu.:0 1st Qu.:1.0000
#> Median :0.000000 Median :0.0000 Median :0 Median :1.0000
#> Mean :0.009375 Mean :0.2906 Mean :0 Mean :0.9531
#> 3rd Qu.:0.000000 3rd Qu.:0.0000 3rd Qu.:0 3rd Qu.:1.0000
#> Max. :1.000000 Max. :7.0000 Max. :0 Max. :1.0000
#> repstatus2 fecstatus2 matstatus2 alive2 stage2
#> Min. :0.0000 Min. :0.0000 Min. :1 Min. :1 Length:320
#> 1st Qu.:0.0000 1st Qu.:0.0000 1st Qu.:1 1st Qu.:1 Class :character
#> Median :0.0000 Median :0.0000 Median :1 Median :1 Mode :character
#> Mean :0.3688 Mean :0.1562 Mean :1 Mean :1
#> 3rd Qu.:1.0000 3rd Qu.:0.0000 3rd Qu.:1 3rd Qu.:1
#> Max. :1.0000 Max. :1.0000 Max. :1 Max. :1
#> stage2index sizea3 sizeb3 sizec3
#> Min. : 6.00 Min. :0.000000 Min. : 0.000 Min. : 0.000
#> 1st Qu.: 7.00 1st Qu.:0.000000 1st Qu.: 0.000 1st Qu.: 1.000
#> Median :10.00 Median :0.000000 Median : 0.000 Median : 1.000
#> Mean :18.17 Mean :0.009375 Mean : 1.069 Mean : 2.209
#> 3rd Qu.:32.00 3rd Qu.:0.000000 3rd Qu.: 1.000 3rd Qu.: 3.000
#> Max. :54.00 Max. :1.000000 Max. :18.000 Max. :13.000
#> size3added repstra3 repstrb3 feca3
#> Min. : 0.000 Min. : 0.000 Min. :0.000000 Min. :0.0000
#> 1st Qu.: 1.000 1st Qu.: 0.000 1st Qu.:0.000000 1st Qu.:0.0000
#> Median : 2.000 Median : 0.000 Median :0.000000 Median :0.0000
#> Mean : 3.288 Mean : 1.069 Mean :0.009375 Mean :0.4562
#> 3rd Qu.: 4.000 3rd Qu.: 1.000 3rd Qu.:0.000000 3rd Qu.:0.0000
#> Max. :24.000 Max. :18.000 Max. :1.000000 Max. :8.0000
#> juvgiven3 obsstatus3 repstatus3 fecstatus3 matstatus3
#> Min. :0 Min. :0.0 Min. :0.0 Min. :0.0000 Min. :1
#> 1st Qu.:0 1st Qu.:1.0 1st Qu.:0.0 1st Qu.:0.0000 1st Qu.:1
#> Median :0 Median :1.0 Median :0.0 Median :0.0000 Median :1
#> Mean :0 Mean :0.9 Mean :0.4 Mean :0.2219 Mean :1
#> 3rd Qu.:0 3rd Qu.:1.0 3rd Qu.:1.0 3rd Qu.:0.0000 3rd Qu.:1
#> Max. :0 Max. :1.0 Max. :1.0 Max. :1.0000 Max. :1
#> alive3 stage3 stage3index
#> Min. :0.0000 Length:320 Min. : 0.00
#> 1st Qu.:1.0000 Class :character 1st Qu.: 7.00
#> Median :1.0000 Mode :character Median :10.00
#> Mean :0.9469 Mean :18.57
#> 3rd Qu.:1.0000 3rd Qu.:33.00
#> Max. :1.0000 Max. :54.00
We may also wish to see how to proceed if our original dataset is already in vertical, but ahistorical, format. This package also includes dataset cypvert, which is the same dataset as cypdata but set in ahistorical vertical format. Here, we will use the historicalize3() function to deal with this dataset, which uses an individual identity variable in order to put all of the data for each individual together. Here, the vertical dataset includes the plantid variable, which is an individual identity term and must be supplied for conversion. Here is the raw MPM dataset.
cypraw_v2 <- historicalize3(data = cypvert, patchidcol = "patch",
individcol = "plantid", year2col = "year2", sizea2col = "Inf2.2",
sizea3col = "Inf2.3", sizeb2col = "Inf.2", sizeb3col = "Inf.3",
sizec2col = "Veg.2", sizec3col = "Veg.3", repstra2col = "Inf2.2",
repstra3col = "Inf2.3", repstrb2col = "Inf.2", repstrb3col = "Inf.3",
feca2col = "Pod.2", feca3col = "Pod.3", repstrrel = 2,
stageassign = cypframe_raw, stagesize = "sizeadded", censorcol = "censor",
censorkeep = 1, censor = FALSE, NAas0 = TRUE, NRasRep = TRUE, reduce = TRUE)
summary(cypraw_v2)
#> rowid popid patchid individ
#> Min. : 0.00 Length:320 Length:320 Length:320
#> 1st Qu.: 82.75 Class :character Class :character Class :character
#> Median :162.50 Mode :character Mode :character Mode :character
#> Mean :163.70
#> 3rd Qu.:245.25
#> Max. :330.00
#> year2 firstseen lastseen obsage obslifespan
#> Min. :2004 Min. :2004 Min. :2004 Min. :0.000 Min. :0.000
#> 1st Qu.:2005 1st Qu.:2004 1st Qu.:2009 1st Qu.:1.000 1st Qu.:5.000
#> Median :2006 Median :2004 Median :2009 Median :2.000 Median :5.000
#> Mean :2006 Mean :2004 Mean :2009 Mean :1.853 Mean :4.556
#> 3rd Qu.:2007 3rd Qu.:2004 3rd Qu.:2009 3rd Qu.:3.000 3rd Qu.:5.000
#> Max. :2008 Max. :2008 Max. :2009 Max. :4.000 Max. :5.000
#> sizea1 sizeb1 sizec1 size1added
#> Min. :0.000000 Min. : 0.0000 Min. : 0.0 Min. : 0.000
#> 1st Qu.:0.000000 1st Qu.: 0.0000 1st Qu.: 0.0 1st Qu.: 0.000
#> Median :0.000000 Median : 0.0000 Median : 1.0 Median : 2.000
#> Mean :0.009375 Mean : 0.7469 Mean : 1.9 Mean : 2.656
#> 3rd Qu.:0.000000 3rd Qu.: 1.0000 3rd Qu.: 3.0 3rd Qu.: 4.000
#> Max. :1.000000 Max. :18.0000 Max. :13.0 Max. :21.000
#> repstra1 repstrb1 feca1 juvgiven1
#> Min. :0.000000 Min. : 0.0000 Min. :0.0000 Min. :0
#> 1st Qu.:0.000000 1st Qu.: 0.0000 1st Qu.:0.0000 1st Qu.:0
#> Median :0.000000 Median : 0.0000 Median :0.0000 Median :0
#> Mean :0.009375 Mean : 0.7469 Mean :0.2656 Mean :0
#> 3rd Qu.:0.000000 3rd Qu.: 1.0000 3rd Qu.:0.0000 3rd Qu.:0
#> Max. :1.000000 Max. :18.0000 Max. :7.0000 Max. :0
#> obsstatus1 repstatus1 fecstatus1 matstatus1
#> Min. :0.0000 Min. :0.0000 Min. :0.0000 Min. :0.0000
#> 1st Qu.:0.0000 1st Qu.:0.0000 1st Qu.:0.0000 1st Qu.:1.0000
#> Median :1.0000 Median :0.0000 Median :0.0000 Median :1.0000
#> Mean :0.7469 Mean :0.2875 Mean :0.1344 Mean :0.7688
#> 3rd Qu.:1.0000 3rd Qu.:1.0000 3rd Qu.:0.0000 3rd Qu.:1.0000
#> Max. :1.0000 Max. :1.0000 Max. :1.0000 Max. :1.0000
#> alive1 stage1 stage1index sizea2
#> Min. :0.0000 Length:320 Min. : 0.000 Min. :0.000000
#> 1st Qu.:1.0000 Class :character 1st Qu.: 6.000 1st Qu.:0.000000
#> Median :1.0000 Mode :character Median : 8.000 Median :0.000000
#> Mean :0.7688 Mean : 6.144 Mean :0.009375
#> 3rd Qu.:1.0000 3rd Qu.: 8.000 3rd Qu.:0.000000
#> Max. :1.0000 Max. :11.000 Max. :1.000000
#> sizeb2 sizec2 size2added repstra2
#> Min. : 0.0000 Min. : 0.000 Min. : 0.000 Min. :0.000000
#> 1st Qu.: 0.0000 1st Qu.: 1.000 1st Qu.: 1.000 1st Qu.:0.000000
#> Median : 0.0000 Median : 2.000 Median : 2.000 Median :0.000000
#> Mean : 0.8969 Mean : 2.416 Mean : 3.322 Mean :0.009375
#> 3rd Qu.: 1.0000 3rd Qu.: 3.000 3rd Qu.: 4.000 3rd Qu.:0.000000
#> Max. :18.0000 Max. :13.000 Max. :24.000 Max. :1.000000
#> repstrb2 feca2 juvgiven2 obsstatus2
#> Min. : 0.0000 Min. :0.0000 Min. :0 Min. :0.0000
#> 1st Qu.: 0.0000 1st Qu.:0.0000 1st Qu.:0 1st Qu.:1.0000
#> Median : 0.0000 Median :0.0000 Median :0 Median :1.0000
#> Mean : 0.8969 Mean :0.2906 Mean :0 Mean :0.9531
#> 3rd Qu.: 1.0000 3rd Qu.:0.0000 3rd Qu.:0 3rd Qu.:1.0000
#> Max. :18.0000 Max. :7.0000 Max. :0 Max. :1.0000
#> repstatus2 fecstatus2 matstatus2 alive2 stage2
#> Min. :0.0000 Min. :0.0000 Min. :1 Min. :1 Length:320
#> 1st Qu.:0.0000 1st Qu.:0.0000 1st Qu.:1 1st Qu.:1 Class :character
#> Median :0.0000 Median :0.0000 Median :1 Median :1 Mode :character
#> Mean :0.3688 Mean :0.1562 Mean :1 Mean :1
#> 3rd Qu.:1.0000 3rd Qu.:0.0000 3rd Qu.:1 3rd Qu.:1
#> Max. :1.0000 Max. :1.0000 Max. :1 Max. :1
#> stage2index sizea3 sizeb3 sizec3
#> Min. : 6.000 Min. :0.000000 Min. : 0.000 Min. : 0.000
#> 1st Qu.: 7.000 1st Qu.:0.000000 1st Qu.: 0.000 1st Qu.: 1.000
#> Median : 8.000 Median :0.000000 Median : 0.000 Median : 1.000
#> Mean : 7.919 Mean :0.009375 Mean : 1.069 Mean : 2.209
#> 3rd Qu.: 8.000 3rd Qu.:0.000000 3rd Qu.: 1.000 3rd Qu.: 3.000
#> Max. :11.000 Max. :1.000000 Max. :18.000 Max. :13.000
#> size3added repstra3 repstrb3 feca3
#> Min. : 0.000 Min. :0.000000 Min. : 0.000 Min. :0.0000
#> 1st Qu.: 1.000 1st Qu.:0.000000 1st Qu.: 0.000 1st Qu.:0.0000
#> Median : 2.000 Median :0.000000 Median : 0.000 Median :0.0000
#> Mean : 3.288 Mean :0.009375 Mean : 1.069 Mean :0.4562
#> 3rd Qu.: 4.000 3rd Qu.:0.000000 3rd Qu.: 1.000 3rd Qu.:0.0000
#> Max. :24.000 Max. :1.000000 Max. :18.000 Max. :8.0000
#> juvgiven3 obsstatus3 repstatus3 fecstatus3 matstatus3
#> Min. :0 Min. :0.0 Min. :0.0 Min. :0.0000 Min. :1
#> 1st Qu.:0 1st Qu.:1.0 1st Qu.:0.0 1st Qu.:0.0000 1st Qu.:1
#> Median :0 Median :1.0 Median :0.0 Median :0.0000 Median :1
#> Mean :0 Mean :0.9 Mean :0.4 Mean :0.2219 Mean :1
#> 3rd Qu.:0 3rd Qu.:1.0 3rd Qu.:1.0 3rd Qu.:0.0000 3rd Qu.:1
#> Max. :0 Max. :1.0 Max. :1.0 Max. :1.0000 Max. :1
#> alive3 stage3 stage3index
#> Min. :0.0000 Length:320 Min. : 0.000
#> 1st Qu.:1.0000 Class :character 1st Qu.: 7.000
#> Median :1.0000 Mode :character Median : 8.000
#> Mean :0.9469 Mean : 7.544
#> 3rd Qu.:1.0000 3rd Qu.: 8.000
#> Max. :1.0000 Max. :11.000
Let’s also create the function-based MPM version.
cypfb_v2 <- historicalize3(data = cypvert, patchidcol = "patch",
individcol = "plantid", year2col = "year2", sizea2col = "Inf2.2",
sizea3col = "Inf2.3", sizeb2col = "Inf.2", sizeb3col = "Inf.3",
sizec2col = "Veg.2", sizec3col = "Veg.3", repstra2col = "Inf2.2",
repstra3col = "Inf2.3", repstrb2col = "Inf.2", repstrb3col = "Inf.3",
feca2col = "Pod.2", feca3col = "Pod.3", repstrrel = 2,
stageassign = cypframe_fb, stagesize = "sizeadded", censorcol = "censor",
censorkeep = 1, censor = FALSE, NAas0 = TRUE, reduce = TRUE)
summary(cypfb_v2)
#> rowid popid patchid individ
#> Min. : 0.00 Length:320 Length:320 Length:320
#> 1st Qu.: 82.75 Class :character Class :character Class :character
#> Median :162.50 Mode :character Mode :character Mode :character
#> Mean :163.70
#> 3rd Qu.:245.25
#> Max. :330.00
#> year2 firstseen lastseen obsage obslifespan
#> Min. :2004 Min. :2004 Min. :2004 Min. :0.000 Min. :0.000
#> 1st Qu.:2005 1st Qu.:2004 1st Qu.:2009 1st Qu.:1.000 1st Qu.:5.000
#> Median :2006 Median :2004 Median :2009 Median :2.000 Median :5.000
#> Mean :2006 Mean :2004 Mean :2009 Mean :1.853 Mean :4.556
#> 3rd Qu.:2007 3rd Qu.:2004 3rd Qu.:2009 3rd Qu.:3.000 3rd Qu.:5.000
#> Max. :2008 Max. :2008 Max. :2009 Max. :4.000 Max. :5.000
#> sizea1 sizeb1 sizec1 size1added
#> Min. :0.000000 Min. : 0.0000 Min. : 0.0 Min. : 0.000
#> 1st Qu.:0.000000 1st Qu.: 0.0000 1st Qu.: 0.0 1st Qu.: 0.000
#> Median :0.000000 Median : 0.0000 Median : 1.0 Median : 2.000
#> Mean :0.009375 Mean : 0.7469 Mean : 1.9 Mean : 2.656
#> 3rd Qu.:0.000000 3rd Qu.: 1.0000 3rd Qu.: 3.0 3rd Qu.: 4.000
#> Max. :1.000000 Max. :18.0000 Max. :13.0 Max. :21.000
#> repstra1 repstrb1 feca1 juvgiven1
#> Min. :0.000000 Min. : 0.0000 Min. :0.0000 Min. :0
#> 1st Qu.:0.000000 1st Qu.: 0.0000 1st Qu.:0.0000 1st Qu.:0
#> Median :0.000000 Median : 0.0000 Median :0.0000 Median :0
#> Mean :0.009375 Mean : 0.7469 Mean :0.2656 Mean :0
#> 3rd Qu.:0.000000 3rd Qu.: 1.0000 3rd Qu.:0.0000 3rd Qu.:0
#> Max. :1.000000 Max. :18.0000 Max. :7.0000 Max. :0
#> obsstatus1 repstatus1 fecstatus1 matstatus1
#> Min. :0.0000 Min. :0.0000 Min. :0.0000 Min. :0.0000
#> 1st Qu.:0.0000 1st Qu.:0.0000 1st Qu.:0.0000 1st Qu.:1.0000
#> Median :1.0000 Median :0.0000 Median :0.0000 Median :1.0000
#> Mean :0.7469 Mean :0.2875 Mean :0.1344 Mean :0.7688
#> 3rd Qu.:1.0000 3rd Qu.:1.0000 3rd Qu.:0.0000 3rd Qu.:1.0000
#> Max. :1.0000 Max. :1.0000 Max. :1.0000 Max. :1.0000
#> alive1 stage1 stage1index sizea2
#> Min. :0.0000 Length:320 Min. : 0.00 Min. :0.000000
#> 1st Qu.:1.0000 Class :character 1st Qu.: 6.00 1st Qu.:0.000000
#> Median :1.0000 Mode :character Median : 8.00 Median :0.000000
#> Mean :0.7688 Mean :14.17 Mean :0.009375
#> 3rd Qu.:1.0000 3rd Qu.:31.00 3rd Qu.:0.000000
#> Max. :1.0000 Max. :51.00 Max. :1.000000
#> sizeb2 sizec2 size2added repstra2
#> Min. : 0.0000 Min. : 0.000 Min. : 0.000 Min. :0.000000
#> 1st Qu.: 0.0000 1st Qu.: 1.000 1st Qu.: 1.000 1st Qu.:0.000000
#> Median : 0.0000 Median : 2.000 Median : 2.000 Median :0.000000
#> Mean : 0.8969 Mean : 2.416 Mean : 3.322 Mean :0.009375
#> 3rd Qu.: 1.0000 3rd Qu.: 3.000 3rd Qu.: 4.000 3rd Qu.:0.000000
#> Max. :18.0000 Max. :13.000 Max. :24.000 Max. :1.000000
#> repstrb2 feca2 juvgiven2 obsstatus2
#> Min. : 0.0000 Min. :0.0000 Min. :0 Min. :0.0000
#> 1st Qu.: 0.0000 1st Qu.:0.0000 1st Qu.:0 1st Qu.:1.0000
#> Median : 0.0000 Median :0.0000 Median :0 Median :1.0000
#> Mean : 0.8969 Mean :0.2906 Mean :0 Mean :0.9531
#> 3rd Qu.: 1.0000 3rd Qu.:0.0000 3rd Qu.:0 3rd Qu.:1.0000
#> Max. :18.0000 Max. :7.0000 Max. :0 Max. :1.0000
#> repstatus2 fecstatus2 matstatus2 alive2 stage2
#> Min. :0.0000 Min. :0.0000 Min. :1 Min. :1 Length:320
#> 1st Qu.:0.0000 1st Qu.:0.0000 1st Qu.:1 1st Qu.:1 Class :character
#> Median :0.0000 Median :0.0000 Median :1 Median :1 Mode :character
#> Mean :0.3688 Mean :0.1562 Mean :1 Mean :1
#> 3rd Qu.:1.0000 3rd Qu.:0.0000 3rd Qu.:1 3rd Qu.:1
#> Max. :1.0000 Max. :1.0000 Max. :1 Max. :1
#> stage2index sizea3 sizeb3 sizec3
#> Min. : 6.00 Min. :0.000000 Min. : 0.000 Min. : 0.000
#> 1st Qu.: 7.00 1st Qu.:0.000000 1st Qu.: 0.000 1st Qu.: 1.000
#> Median :10.00 Median :0.000000 Median : 0.000 Median : 1.000
#> Mean :18.17 Mean :0.009375 Mean : 1.069 Mean : 2.209
#> 3rd Qu.:32.00 3rd Qu.:0.000000 3rd Qu.: 1.000 3rd Qu.: 3.000
#> Max. :54.00 Max. :1.000000 Max. :18.000 Max. :13.000
#> size3added repstra3 repstrb3 feca3
#> Min. : 0.000 Min. :0.000000 Min. : 0.000 Min. :0.0000
#> 1st Qu.: 1.000 1st Qu.:0.000000 1st Qu.: 0.000 1st Qu.:0.0000
#> Median : 2.000 Median :0.000000 Median : 0.000 Median :0.0000
#> Mean : 3.288 Mean :0.009375 Mean : 1.069 Mean :0.4562
#> 3rd Qu.: 4.000 3rd Qu.:0.000000 3rd Qu.: 1.000 3rd Qu.:0.0000
#> Max. :24.000 Max. :1.000000 Max. :18.000 Max. :8.0000
#> juvgiven3 obsstatus3 repstatus3 fecstatus3 matstatus3
#> Min. :0 Min. :0.0 Min. :0.0 Min. :0.0000 Min. :1
#> 1st Qu.:0 1st Qu.:1.0 1st Qu.:0.0 1st Qu.:0.0000 1st Qu.:1
#> Median :0 Median :1.0 Median :0.0 Median :0.0000 Median :1
#> Mean :0 Mean :0.9 Mean :0.4 Mean :0.2219 Mean :1
#> 3rd Qu.:0 3rd Qu.:1.0 3rd Qu.:1.0 3rd Qu.:0.0000 3rd Qu.:1
#> Max. :0 Max. :1.0 Max. :1.0 Max. :1.0000 Max. :1
#> alive3 stage3 stage3index
#> Min. :0.0000 Length:320 Min. : 0.00
#> 1st Qu.:1.0000 Class :character 1st Qu.: 7.00
#> Median :1.0000 Mode :character Median :10.00
#> Mean :0.9469 Mean :18.57
#> 3rd Qu.:1.0000 3rd Qu.:33.00
#> Max. :1.0000 Max. :54.00
We can compare the dimensions of these datasets.
dim(cypraw_v1)
#> [1] 320 54
dim(cypraw_v2)
#> [1] 320 54
dim(cypfb_v1)
#> [1] 320 54
dim(cypfb_v2)
#> [1] 320 54
The lengths of the datasets are the same in terms of rows and columns, and the variables and data are the same although the order of the columns and rows might not match (see the summaries for comparison).
Let’s now move on to supplying R with the proxy transitions that we need to properly parameterize our models.
The next steps involve adding some external data to parameterize the matrices properly. There are two approaches for this:
supplemental() function, oroverwrite() function.
We advise the use of the first approach, the supplemental() function, which is more holistic and flexible than the other approach. The supplemental() function provides a means of inputting three kinds of data into MPM construction:
We will start off by creating two supplemental tables taking all of these sorts of data for the function-based MPMs. The first is the supplemental table for the historical analysis, and the second table covers the ahistorical analysis. Each row refers to a specific transition, and in the historical case, there are codes for 16 given transitions (11 for the ahistorical case). The first 9 of the historical transitions are set to specific probabilities, and the next 5 are transitions that will be set to other, estimated transitions (these are the non-NA transitions in eststage set below). The final 2 terms are fecundity multipliers. Based on the literature, the proxies for entry into the adult classes are transitions from dormancy, as below. However, in the raw dataset, dormancy is not common enough to use as an effective proxy in raw matrix creation. Hence, we can use different proxies for function-based matrix estimation than for raw matrix estimation. Where necessary, we also use rep and mat as shorthand to code for all reproductive stages and all mature stages, respectively.
Here is the historical supplemental table. We will also introduce a variable representing the number of seeds expected per pod (the term ‘pod’ refers to the fruits that orchids make). Note that the number of seeds per fruit is actually likely higher than this, but we are using this number to reflect the relatively stable population dynamics that we see in the population.
seeds_per_pod <- 5000
cypsupp3_fb <- supplemental(stage3 = c("SD", "SD", "P1", "P1", "P2", "P3", "SL",
"SL", "SL", "D", "V1", "D", "V1", "V2", "SD", "P1"),
stage2 = c("SD", "SD", "SD", "SD", "P1", "P2", "P3", "SL", "SL", "SL", "SL",
"SL", "SL", "SL", "rep", "rep"),
stage1 = c("SD", "rep", "SD", "rep", "SD", "P1", "P2", "P3", "SL", "P3", "P3",
"SL", "SL", "SL", "mat", "mat"),
eststage3 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, "D", "V1", "D", "V1",
"V2", NA, NA),
eststage2 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, "D", "D", "D", "D",
"D", NA, NA),
eststage1 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, "D", "D", "D", "D",
"D", NA, NA),
givenrate = c(0.01, 0.05, 0.10, 0.20, 0.1, 0.1, 0.05, 0.05, 0.05, NA, NA, NA,
NA, NA, NA, NA),
multiplier = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
(0.5 * seeds_per_pod), (0.5 * seeds_per_pod)),
type = c("S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S",
"R", "R"),
type_t12 = c("S", "F", "S", "F", "S", "S", "S", "S", "S", "S", "S", "S", "S",
"S", "S", "S"), stageframe = cypframe_fb)
cypsupp3_fb
#> stage3 stage2 stage1 eststage3 eststage2 eststage1 givenrate multiplier
#> 1 SD SD SD <NA> <NA> <NA> 0.01 NA
#> 2 SD SD rep <NA> <NA> <NA> 0.05 NA
#> 3 P1 SD SD <NA> <NA> <NA> 0.10 NA
#> 4 P1 SD rep <NA> <NA> <NA> 0.20 NA
#> 5 P2 P1 SD <NA> <NA> <NA> 0.10 NA
#> 6 P3 P2 P1 <NA> <NA> <NA> 0.10 NA
#> 7 SL P3 P2 <NA> <NA> <NA> 0.05 NA
#> 8 SL SL P3 <NA> <NA> <NA> 0.05 NA
#> 9 SL SL SL <NA> <NA> <NA> 0.05 NA
#> 10 D SL P3 D D D NA NA
#> 11 V1 SL P3 V1 D D NA NA
#> 12 D SL SL D D D NA NA
#> 13 V1 SL SL V1 D D NA NA
#> 14 V2 SL SL V2 D D NA NA
#> 15 SD rep mat <NA> <NA> <NA> NA 2500
#> 16 P1 rep mat <NA> <NA> <NA> NA 2500
#> convtype convtype_t12
#> 1 1 1
#> 2 1 2
#> 3 1 1
#> 4 1 2
#> 5 1 1
#> 6 1 1
#> 7 1 1
#> 8 1 1
#> 9 1 1
#> 10 1 1
#> 11 1 1
#> 12 1 1
#> 13 1 1
#> 14 1 1
#> 15 3 1
#> 16 3 1
Now we can input the ahistorical table.
cypsupp2_fb <- supplemental(stage3 = c("SD", "P1", "P2", "P3", "SL", "SL", "D",
"V1", "V2", "SD", "P1"),
stage2 = c("SD", "SD", "P1", "P2", "P3", "SL", "SL", "SL", "SL", "rep",
"rep"),
eststage3 = c(NA, NA, NA, NA, NA, NA, "D", "V1", "V2", NA, NA),
eststage2 = c(NA, NA, NA, NA, NA, NA, "D", "D", "D", NA, NA),
givenrate = c(0.03, 0.15, 0.1, 0.1, 0.1, 0.05, NA, NA, NA, NA, NA),
multiplier = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, (0.5* seeds_per_pod),
(0.5 * seeds_per_pod)),
type = c("S", "S", "S", "S", "S", "S", "S", "S", "S", "R", "R"),
stageframe = cypframe_fb, historical = FALSE)
cypsupp2_fb
#> stage3 stage2 stage1 eststage3 eststage2 eststage1 givenrate multiplier
#> 1 SD SD <NA> <NA> <NA> <NA> 0.03 NA
#> 2 P1 SD <NA> <NA> <NA> <NA> 0.15 NA
#> 3 P2 P1 <NA> <NA> <NA> <NA> 0.10 NA
#> 4 P3 P2 <NA> <NA> <NA> <NA> 0.10 NA
#> 5 SL P3 <NA> <NA> <NA> <NA> 0.10 NA
#> 6 SL SL <NA> <NA> <NA> <NA> 0.05 NA
#> 7 D SL <NA> D D <NA> NA NA
#> 8 V1 SL <NA> V1 D <NA> NA NA
#> 9 V2 SL <NA> V2 D <NA> NA NA
#> 10 SD rep <NA> <NA> <NA> <NA> NA 2500
#> 11 P1 rep <NA> <NA> <NA> <NA> NA 2500
#> convtype convtype_t12
#> 1 1 1
#> 2 1 1
#> 3 1 1
#> 4 1 1
#> 5 1 1
#> 6 1 1
#> 7 1 1
#> 8 1 1
#> 9 1 1
#> 10 3 1
#> 11 3 1
These supplemental tables provide the best means of adding external data to our MPMs because they allow both specific transitions to be isolated, and because they allow the use of shorthand to identify large groups of transitions (e.g. using mat, rep, immat, prop, or all to signify all mature stages, reproductive stages, immature stages, propagule stages, or simply all stages, respectively). Let’s now also supply the supplemental tables for the raw MPMs.
cypsupp3_raw <- supplemental(stage3 = c("SD", "SD", "P1", "P1", "P2", "P3",
"SL", "SL", "SL", "D", "D", "SD", "P1"),
stage2 = c("SD", "SD", "SD", "SD", "P1", "P2", "P3", "SL", "SL", "SL", "SL",
"rep", "rep"),
stage1 = c("SD", "rep", "SD", "rep", "SD", "P1", "P2", "P3", "SL", "P3",
"SL", "mat", "mat"),
eststage3 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, "XSm", "D", NA, NA),
eststage2 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, "XSm", "XSm", NA, NA),
eststage1 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, "XSm", "XSm", NA, NA),
givenrate = c(0.01, 0.05, 0.10, 0.20, 0.1, 0.1, 0.05, 0.05, 0.05, NA, NA,
NA, NA),
multiplier = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
(0.5 * seeds_per_pod), (0.5 * seeds_per_pod)),
type = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3),
type_t12 = c(1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1),
stageframe = cypframe_raw, historical = TRUE)
cypsupp2_raw <- supplemental(stage3 = c("SD", "P1", "P2", "P3", "SL", "SL", "D",
"XSm", "SD", "P1"),
stage2 = c("SD", "SD", "P1", "P2", "P3", "SL", "SL", "SL", "rep", "rep"),
eststage3 = c(NA, NA, NA, NA, NA, NA, "D", "XSm", NA, NA),
eststage2 = c(NA, NA, NA, NA, NA, NA, "XSm", "XSm", NA, NA),
givenrate = c(0.03, 0.15, 0.1, 0.1, 0.1, 0.05, NA, NA, NA, NA),
multiplier = c(NA, NA, NA, NA, NA, NA, NA, NA, (0.5 * seeds_per_pod),
(0.5 * seeds_per_pod)),
type =c(1, 1, 1, 1, 1, 1, 1, 1, 3, 3),
stageframe = cypframe_raw, historical = FALSE)
cypsupp3_raw
#> stage3 stage2 stage1 eststage3 eststage2 eststage1 givenrate multiplier
#> 1 SD SD SD <NA> <NA> <NA> 0.01 NA
#> 2 SD SD rep <NA> <NA> <NA> 0.05 NA
#> 3 P1 SD SD <NA> <NA> <NA> 0.10 NA
#> 4 P1 SD rep <NA> <NA> <NA> 0.20 NA
#> 5 P2 P1 SD <NA> <NA> <NA> 0.10 NA
#> 6 P3 P2 P1 <NA> <NA> <NA> 0.10 NA
#> 7 SL P3 P2 <NA> <NA> <NA> 0.05 NA
#> 8 SL SL P3 <NA> <NA> <NA> 0.05 NA
#> 9 SL SL SL <NA> <NA> <NA> 0.05 NA
#> 10 D SL P3 XSm XSm XSm NA NA
#> 11 D SL SL D XSm XSm NA NA
#> 12 SD rep mat <NA> <NA> <NA> NA 2500
#> 13 P1 rep mat <NA> <NA> <NA> NA 2500
#> convtype convtype_t12
#> 1 1 1
#> 2 1 2
#> 3 1 1
#> 4 1 2
#> 5 1 1
#> 6 1 1
#> 7 1 1
#> 8 1 1
#> 9 1 1
#> 10 1 1
#> 11 1 1
#> 12 3 1
#> 13 3 1
cypsupp2_raw
#> stage3 stage2 stage1 eststage3 eststage2 eststage1 givenrate multiplier
#> 1 SD SD <NA> <NA> <NA> <NA> 0.03 NA
#> 2 P1 SD <NA> <NA> <NA> <NA> 0.15 NA
#> 3 P2 P1 <NA> <NA> <NA> <NA> 0.10 NA
#> 4 P3 P2 <NA> <NA> <NA> <NA> 0.10 NA
#> 5 SL P3 <NA> <NA> <NA> <NA> 0.10 NA
#> 6 SL SL <NA> <NA> <NA> <NA> 0.05 NA
#> 7 D SL <NA> D XSm <NA> NA NA
#> 8 XSm SL <NA> XSm XSm <NA> NA NA
#> 9 SD rep <NA> <NA> <NA> <NA> NA 2500
#> 10 P1 rep <NA> <NA> <NA> <NA> NA 2500
#> convtype convtype_t12
#> 1 1 1
#> 2 1 1
#> 3 1 1
#> 4 1 1
#> 5 1 1
#> 6 1 1
#> 7 1 1
#> 8 1 1
#> 9 3 1
#> 10 3 1
The supplemental tables provide all of the information that we need. However, there is an alternative means of supplying this information, and that is through the creation of a reproductive matrix and an overwrite table. The reproductive matrix is an ahistorical matrix detailing where fecundity rates are set, and at what level. Cypripedium candidum produces seeds that germinate by the following growing season (stage P1, or a first year protocorm), or that remain dormant for the next year (stage SD). In the following matrix, we detail that the fecundity of each reproductive stage needs to be split into two between each of these output stages. The actual split places 50% of the fecundity of a reproductive stage into each category of recruit, where the full fecundity is estimated by linear models that we will create. This reproductive matrix can be used in historical MPM construction, and it is assumed that stage at occasion t-1 is set to all.
rep.assumptions_fb <- matrix(0, 54, 54)
rep.assumptions_fb[1:2,31:54] <- 0.5 * seeds_per_pod
rep.assumptions_fb
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
#> [1,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [2,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [3,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [4,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [5,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [6,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [7,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [8,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [9,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [10,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [11,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [12,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [13,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [14,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [15,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [16,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [17,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [18,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [19,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [20,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [21,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [22,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [23,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [24,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [25,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [26,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [27,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [28,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [29,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [30,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [31,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [32,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [33,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [34,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [35,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [36,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [37,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [38,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [39,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [40,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [41,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [42,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [43,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [44,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [45,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [46,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [47,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [48,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [49,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [50,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [51,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [52,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [53,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [54,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
#> [1,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [2,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [3,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [4,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [5,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [6,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [7,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [8,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [9,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [10,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [11,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [12,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [13,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [14,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [15,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [16,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [17,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [18,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [19,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [20,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [21,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [22,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [23,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [24,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [25,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [26,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [27,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [28,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [29,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [30,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [31,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [32,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [33,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [34,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [35,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [36,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [37,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [38,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [39,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [40,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [41,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [42,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [43,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [44,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [45,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [46,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [47,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [48,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [49,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [50,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [51,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [52,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [53,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [54,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37]
#> [1,] 0 0 0 0 0 2500 2500 2500 2500 2500 2500 2500
#> [2,] 0 0 0 0 0 2500 2500 2500 2500 2500 2500 2500
#> [3,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [4,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [5,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [6,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [7,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [8,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [9,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [10,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [11,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [12,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [13,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [14,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [15,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [16,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [17,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [18,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [19,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [20,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [21,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [22,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [23,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [24,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [25,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [26,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [27,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [28,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [29,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [30,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [31,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [32,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [33,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [34,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [35,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [36,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [37,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [38,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [39,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [40,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [41,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [42,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [43,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [44,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [45,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [46,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [47,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [48,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [49,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [50,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [51,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [52,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [53,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [54,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [,38] [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49]
#> [1,] 2500 2500 2500 2500 2500 2500 2500 2500 2500 2500 2500 2500
#> [2,] 2500 2500 2500 2500 2500 2500 2500 2500 2500 2500 2500 2500
#> [3,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [4,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [5,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [6,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [7,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [8,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [9,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [10,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [11,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [12,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [13,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [14,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [15,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [16,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [17,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [18,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [19,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [20,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [21,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [22,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [23,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [24,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [25,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [26,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [27,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [28,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [29,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [30,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [31,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [32,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [33,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [34,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [35,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [36,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [37,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [38,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [39,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [40,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [41,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [42,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [43,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [44,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [45,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [46,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [47,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [48,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [49,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [50,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [51,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [52,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [53,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [54,] 0 0 0 0 0 0 0 0 0 0 0 0
#> [,50] [,51] [,52] [,53] [,54]
#> [1,] 2500 2500 2500 2500 2500
#> [2,] 2500 2500 2500 2500 2500
#> [3,] 0 0 0 0 0
#> [4,] 0 0 0 0 0
#> [5,] 0 0 0 0 0
#> [6,] 0 0 0 0 0
#> [7,] 0 0 0 0 0
#> [8,] 0 0 0 0 0
#> [9,] 0 0 0 0 0
#> [10,] 0 0 0 0 0
#> [11,] 0 0 0 0 0
#> [12,] 0 0 0 0 0
#> [13,] 0 0 0 0 0
#> [14,] 0 0 0 0 0
#> [15,] 0 0 0 0 0
#> [16,] 0 0 0 0 0
#> [17,] 0 0 0 0 0
#> [18,] 0 0 0 0 0
#> [19,] 0 0 0 0 0
#> [20,] 0 0 0 0 0
#> [21,] 0 0 0 0 0
#> [22,] 0 0 0 0 0
#> [23,] 0 0 0 0 0
#> [24,] 0 0 0 0 0
#> [25,] 0 0 0 0 0
#> [26,] 0 0 0 0 0
#> [27,] 0 0 0 0 0
#> [28,] 0 0 0 0 0
#> [29,] 0 0 0 0 0
#> [30,] 0 0 0 0 0
#> [31,] 0 0 0 0 0
#> [32,] 0 0 0 0 0
#> [33,] 0 0 0 0 0
#> [34,] 0 0 0 0 0
#> [35,] 0 0 0 0 0
#> [36,] 0 0 0 0 0
#> [37,] 0 0 0 0 0
#> [38,] 0 0 0 0 0
#> [39,] 0 0 0 0 0
#> [40,] 0 0 0 0 0
#> [41,] 0 0 0 0 0
#> [42,] 0 0 0 0 0
#> [43,] 0 0 0 0 0
#> [44,] 0 0 0 0 0
#> [45,] 0 0 0 0 0
#> [46,] 0 0 0 0 0
#> [47,] 0 0 0 0 0
#> [48,] 0 0 0 0 0
#> [49,] 0 0 0 0 0
#> [50,] 0 0 0 0 0
#> [51,] 0 0 0 0 0
#> [52,] 0 0 0 0 0
#> [53,] 0 0 0 0 0
#> [54,] 0 0 0 0 0
Next we will create the overwrite tables, which outline transitions that cannot be estimated from the data set and need to be set by other means. Here is an example of two overwrite tables for the Cypripedium candidum analysis. Note that they are fundamentally similar to supplemental tables, but do not allow the addition of fecundity multipliers and transition types from occasion t-1 to t, nor do they involve a check of entered stages against the stage frame.
cypover3_fb <- overwrite(stage3 = c("SD", "SD", "P1", "P1", "P2", "P3", "SL", "SL",
"SL", "D", "V1", "D", "V1", "V2"),
stage2 = c("SD", "SD", "SD", "SD", "P1", "P2", "P3", "SL", "SL", "SL", "SL",
"SL", "SL", "SL"),
stage1 = c("SD", "rep", "SD", "rep", "SD", "P1", "P2", "P3", "SL", "P3", "P3",
"SL", "SL", "SL"),
eststage3 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, "D", "V1", "D",
"V1", "V2"),
eststage2 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, "D", "D", "D", "D",
"D"),
eststage1 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, "D", "D", "D", "D",
"D"),
givenrate = c(0.01, 0.05, 0.10, 0.20, 0.1, 0.1, 0.05, 0.05, 0.05, NA, NA, NA,
NA, NA),
type = c("S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S",
"S"))
cypover2_fb <- overwrite(stage3 = c("SD", "P1", "P2", "P3", "SL", "SL", "D", "V1",
"V2"),
stage2 = c("SD", "SD", "P1", "P2", "P3", "SL", "SL", "SL", "SL"),
eststage3 = c(NA, NA, NA, NA, NA, NA, "D", "V1", "V2"),
eststage2 = c(NA, NA, NA, NA, NA, NA, "D", "D", "D"),
givenrate = c(0.03, 0.15, 0.1, 0.1, 0.1, 0.05, NA, NA, NA),
type = c("S", "S", "S", "S", "S", "S", "S", "S", "S"))
cypover3_fb
#> stage3 stage2 stage1 eststage3 eststage2 eststage1 givenrate convtype
#> 1 SD SD SD <NA> <NA> <NA> 0.01 1
#> 2 SD SD rep <NA> <NA> <NA> 0.05 1
#> 3 P1 SD SD <NA> <NA> <NA> 0.10 1
#> 4 P1 SD rep <NA> <NA> <NA> 0.20 1
#> 5 P2 P1 SD <NA> <NA> <NA> 0.10 1
#> 6 P3 P2 P1 <NA> <NA> <NA> 0.10 1
#> 7 SL P3 P2 <NA> <NA> <NA> 0.05 1
#> 8 SL SL P3 <NA> <NA> <NA> 0.05 1
#> 9 SL SL SL <NA> <NA> <NA> 0.05 1
#> 10 D SL P3 D D D NA 1
#> 11 V1 SL P3 V1 D D NA 1
#> 12 D SL SL D D D NA 1
#> 13 V1 SL SL V1 D D NA 1
#> 14 V2 SL SL V2 D D NA 1
#> convtype_t12
#> 1 1
#> 2 1
#> 3 1
#> 4 1
#> 5 1
#> 6 1
#> 7 1
#> 8 1
#> 9 1
#> 10 1
#> 11 1
#> 12 1
#> 13 1
#> 14 1
cypover2_fb
#> stage3 stage2 stage1 eststage3 eststage2 eststage1 givenrate convtype
#> 1 SD SD <NA> <NA> <NA> <NA> 0.03 1
#> 2 P1 SD <NA> <NA> <NA> <NA> 0.15 1
#> 3 P2 P1 <NA> <NA> <NA> <NA> 0.10 1
#> 4 P3 P2 <NA> <NA> <NA> <NA> 0.10 1
#> 5 SL P3 <NA> <NA> <NA> <NA> 0.10 1
#> 6 SL SL <NA> <NA> <NA> <NA> 0.05 1
#> 7 D SL <NA> D D <NA> NA 1
#> 8 V1 SL <NA> V1 D <NA> NA 1
#> 9 V2 SL <NA> V2 D <NA> NA 1
#> convtype_t12
#> 1 1
#> 2 1
#> 3 1
#> 4 1
#> 5 1
#> 6 1
#> 7 1
#> 8 1
#> 9 1
Let’s now also supply the overwrite tables and reproductive matrix for the raw MPM approach.
rep_cyp_raw <- matrix(0, 11, 11)
rep_cyp_raw[1:2,7:11] <- 0.5 * seeds_per_pod
cypover2_raw <- overwrite(stage3 = c("SD", "P1", "P2", "P3", "SL", "SL", "D",
"XSm", "Sm"),
stage2 = c("SD", "SD", "P1", "P2", "P3", "SL", "SL", "SL", "SL"),
eststage3 = c(NA, NA, NA, NA, NA, NA, "D", "XSm", "Sm"),
eststage2 = c(NA, NA, NA, NA, NA, NA, "XSm", "XSm", "XSm"),
givenrate = c(0.03, 0.15, 0.1, 0.1, 0.1, 0.05, NA, NA, NA),
type = c("S", "S", "S", "S", "S", "S", "S", "S", "S"))
cypover3_raw <- overwrite(stage3 = c("SD", "SD", "P1", "P1", "P2", "P3", "SL",
"SL", "SL", "D", "D", "XSm"),
stage2 = c("SD", "SD", "SD", "SD", "P1", "P2", "P3", "SL", "SL", "SL", "SL",
"SL"),
stage1 = c("SD", "rep", "SD", "rep", "SD", "P1", "P2", "P3", "SL", "P3",
"SL", "SL"),
eststage3 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, "D", "D", "XSm"),
eststage2 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, "XSm", "XSm", "XSm"),
eststage1 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, "XSm", "XSm", "XSm"),
givenrate = c(0.01, 0.05, 0.10, 0.20, 0.1, 0.1, 0.05, 0.05, 0.05, NA, NA,
NA),
type = c("S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S"))
rep_cyp_raw
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0 0 0 0 0 0 2500 2500 2500 2500 2500
#> [2,] 0 0 0 0 0 0 2500 2500 2500 2500 2500
#> [3,] 0 0 0 0 0 0 0 0 0 0 0
#> [4,] 0 0 0 0 0 0 0 0 0 0 0
#> [5,] 0 0 0 0 0 0 0 0 0 0 0
#> [6,] 0 0 0 0 0 0 0 0 0 0 0
#> [7,] 0 0 0 0 0 0 0 0 0 0 0
#> [8,] 0 0 0 0 0 0 0 0 0 0 0
#> [9,] 0 0 0 0 0 0 0 0 0 0 0
#> [10,] 0 0 0 0 0 0 0 0 0 0 0
#> [11,] 0 0 0 0 0 0 0 0 0 0 0
cypover2_raw
#> stage3 stage2 stage1 eststage3 eststage2 eststage1 givenrate convtype
#> 1 SD SD <NA> <NA> <NA> <NA> 0.03 1
#> 2 P1 SD <NA> <NA> <NA> <NA> 0.15 1
#> 3 P2 P1 <NA> <NA> <NA> <NA> 0.10 1
#> 4 P3 P2 <NA> <NA> <NA> <NA> 0.10 1
#> 5 SL P3 <NA> <NA> <NA> <NA> 0.10 1
#> 6 SL SL <NA> <NA> <NA> <NA> 0.05 1
#> 7 D SL <NA> D XSm <NA> NA 1
#> 8 XSm SL <NA> XSm XSm <NA> NA 1
#> 9 Sm SL <NA> Sm XSm <NA> NA 1
#> convtype_t12
#> 1 1
#> 2 1
#> 3 1
#> 4 1
#> 5 1
#> 6 1
#> 7 1
#> 8 1
#> 9 1
cypover3_raw
#> stage3 stage2 stage1 eststage3 eststage2 eststage1 givenrate convtype
#> 1 SD SD SD <NA> <NA> <NA> 0.01 1
#> 2 SD SD rep <NA> <NA> <NA> 0.05 1
#> 3 P1 SD SD <NA> <NA> <NA> 0.10 1
#> 4 P1 SD rep <NA> <NA> <NA> 0.20 1
#> 5 P2 P1 SD <NA> <NA> <NA> 0.10 1
#> 6 P3 P2 P1 <NA> <NA> <NA> 0.10 1
#> 7 SL P3 P2 <NA> <NA> <NA> 0.05 1
#> 8 SL SL P3 <NA> <NA> <NA> 0.05 1
#> 9 SL SL SL <NA> <NA> <NA> 0.05 1
#> 10 D SL P3 D XSm XSm NA 1
#> 11 D SL SL D XSm XSm NA 1
#> 12 XSm SL SL XSm XSm XSm NA 1
#> convtype_t12
#> 1 1
#> 2 1
#> 3 1
#> 4 1
#> 5 1
#> 6 1
#> 7 1
#> 8 1
#> 9 1
#> 10 1
#> 11 1
#> 12 1
These approaches are less powerful than the supplemental table approach, but some might prefer their use. We can now proceed to test whether individual history is likely to be of importance in our analyses.
Matrix creation can proceed either as raw matrix creation, as initially outlined in Ehrlén (2000), or via the creation of function-based matrices, in many ways equivalent to complex integral projection models per Ellner and Rees (2006) and as further described in the non-Gaussian case in Shefferson et al. (2014). The function-based approach requires the development of vital rate models, and these vital rate models serve not only to parameterize these matrices but also to allow us to test whether history is important to population dynamics in our study system. This is true even in the raw MPM case. We will proceed by developing vital rate models that test for history, and use these both to understand the overall demography of the system and to parameterize our function-based MPMs.
Prior to vital rate estimation, a number of key decisions need to be made regarding the assumptions underlying the vital rates, and their relationships with the factors under investigation. These decisions include the general modeling strategy, and the size and fecundity distributions.
Most function-based matrices, whether integral projection models or otherwise, are developed using either a generalized linear modeling (GLM) strategy, or a generalized linear mixed modeling (GLMM) strategy. The former is more common and is simpler, but the latter is more theoretically sound because it provides a means of correcting the lack of independence inherent in datasets incorporating repeated sampling of the same individuals. The difference between the two with regards to vital rate modeling is strongly related to assumptions regarding the individual and spatiotemporal variation in vital rates.
In both GLM and GLMM-based MPMs, the underlying dataset utilized is a vertical dataset. Each row of data gives the state of the individual in either two consecutive occasions (the ahistorical case), or three consecutive occasions (the historical case). Under a GLM framework, time in occasion t is a fixed categorical variable, and individual identity is ignored. Treating time as fixed implies that the actual monitoring occasions are the only times for which inference is sought. Thus, if time is treated as fixed, then it would not be correct to infer future population dynamics after 2009 for a dataset collected between 2004 and 2009. Ignoring individual identity treats all transitions as independent, even though data originating from the same sampled individual is clearly not independent of that individual’s previous transitions. This may be interpreted as a form of pseudoreplication because strongly related data is used to create matrices that are assumed to be statistically independent. This might impact demographic modeling by inflating Type 1 error in the linear modeling, yielding more significant terms in the chosen best-fit model and causing the retention of more terms than is warranted.
Under a GLMM (generalized linear mixed model) framework, both time and individual identity can be treated as random categorical terms. This has two major implications. First, both time and individuals can be assumed to be random samples from a broader population of times and individuals for which inference is sought. Thus, sampled monitoring occasions represent a greater universe of years for which inference can be made, and so their associated coefficients can be assumed to come from a normal distribution with \(mean = 0\). Second, treating individual as a random categorical term eliminates the pseudoreplication that is inherent in the GLM approach to vital rate estimation when individuals are monitored potentially many times, because each individual is assumed to be randomly drawn and associated with its own response distribution. Subpopulations may also be considered random, in which case they are assumed to have been sampled from all possible spaces that the species might occupy. We encourage researchers to use the GLMM approach in their demographic work, but we have also included easy-to-use GLM functionality, since many will find the GLM approach particularly useful in cases where mixed modeling breaks down.
Once a general approach is decided upon, the next step is to choose the underlying distributions. The probabilities of survival, observation, and reproductive status are automatically set to the binomial distribution, and this cannot be altered. However, the probability of size transition and the fecundity rate can be set to the Gaussian, Poisson, or negative binomial distributions, with zero-inflated and zero-truncated versions of the Poisson and negative binomial also available. If size or fecundity rate is a continuous variable (i.e., not an integer or count variable), then it should be set to the Gaussian distribution. However, if size or fecundity is a count variable, then it should be set to the Poisson distribution if the mean equals the variance. The negative binomial distribution is provided in cases where the assumption that the mean equals the variance is clearly broken. We do not encourage the use of the negative binomial except in such cases, as the extra parameters estimated for the negative binomial distribution reduce the power of the modeling exercises conducted.
The Poisson and the negative binomial distributions both predict specific numbers of 0s in the response variable. If excess 0s occur within the dataset even after including the observation status and reproductive status as vital rates to absorb 0s, then a zero-inflated Poisson or negative binomial distribution may be used. These modeling approaches work by parameterizing a binomial model, typically with a logit link, to predict 0 responses. The Poisson or negative binomial is then used to predict non-zero responses. This conditional model ends up really acting as two separate models in which 0s are assumed to be predicted under potentially different processes than the remaining counts. Users should be aware that, because an extra model is built to cover 0s, zero-inflated models are much more complex and can include many more parameters than their non-inflated counterparts. The principle of parsimony suggests that they should only be used when there are significantly more 0s than expected.
Cases may arise in which 0s do not exist in either size or fecundity. For these situations, we provide zero-truncated distributions. This may occur in size if all cases of size = 0 are absorbed by observation status, leaving only positive integers for the size of observed individuals. For example, if an unobservable stage such as vegetative dormancy occurs and absorbs all cases of size = 0, then a zero-truncated Poisson or negative binomial distribution will be more appropriate than the equivalent distribution without zero-truncation. It can also occur if all cases of fecundity = 0 are absorbed by reproductive status. Such distributions only involve the estimation of single, conditional models, and so are simpler than zero-inflated models.
Package lefko3 includes a function that can help in determining which distributions to use: sf_distrib(). Here, we use it to determine that we should use the zero-truncated negative binomial for size, and the zero-inflated Poisson for fecundity:
sf_distrib(cypfb_v1, size3 = "size3added", size2 = "size2added",
obs3 = "obsstatus3", fec = "feca2", repst = "repstatus2", zisize = FALSE)
#> The mean size is 3.653
#>
#> The variance in size is 13.41
#>
#> The probability of this dispersion level by chance assuming the true mean size = variance in size, and an alternative hypothesis of overdispersion, is 3.721e-138
#>
#> Size is significantly overdispersed.
#>
#> Mean fecundity is 0.7881
#> The variance in fecundity is 1.536
#> The probability of this dispersion level by chance assuming the true mean fecundity = variance in fecundity, and an alternative hypothesis of overdispersion, is 0.1193
#>
#> Dispersion in fecundity matches expectation.
#>
#>
#> Mean lambda is 0.4547
#> The actual number of 0s in fecundity is 68
#> The expected number of 0s in fecundity under the null hypothesis is 53.65
#> The probability of this deviation in 0s is 5.904e-06
#>
#> Fecundity is significantly zero-inflated.
#> NULL
In lefko3, the modelsearch function is the workhorse that conducts vital rate model estimation. Here, we will create a full suite of vital rate models for the Cypripedium candidum dataset. Before proceeding, we need to decide on the linear model building strategy, the correct vital rates to model, the proper statistical distributions for estimated vital rates, the proper parameterizations for each vital rate, and the strategy for determination of the best-fit models.
First, we must determine the model building strategy. In most cases, the best procedure will be through mixed linear models in which monitoring occasion and individual identity are random terms. We will set monitoring occasion as random because we wish to make inferences for the population as a whole and do not wish to restrict ourselves to inference only for the years monitored (i.e. our distribution of monitoring occasions sampled is itself a sample of the population in time). We will set individual identity as random because many or most of the individuals that we have sampled to produce our dataset yield multiple observation data points across time. Thus, we will set approach = "mixed". To make sure that time and individual identity are treated as random, we will set the proper variable names for indiv and year, corresponding to individual identity (individ by default), and to occasion t (year2 by default). The year.as.random option is set to random by default, and leaving it this way also means that R will randomly draw coefficient values for years with inestimable coefficients. Setting year.as.random to FALSE would make time a fixed categorical variable.
The mixed modeling approach is usually preferable to the GLM approach. However, a mixed modeling strategy results in lower statistical power and a greater time used in estimating models (or, conversely, it yields truer statistical power while the GLM approach inflates Type I error). Users of package lefko3 wishing to use a standard generalized linear modeling strategy can set approach = "glm". In this case, individual identity is not used, time is a fixed categorical factor, and all observed transitions are treated as independent.
Next, we must determine which vital rates to model. Function modelsearch() estimates up to 9 vital rate models:
survival probability from occasion t to occasion t+1,
observation probability in occasion t+1 assuming survival until that time,
size in occasion t+1 assuming survival and observation in that time,
reproduction status in occasion t+1 assuming survival and observation until that time,
fecundity rate assuming survival until and observation and reproduction in the occasion of production of offspring (occasion t or t+1; mature only),
juvenile survival probability from occasion t to occasion t+1,
juvenile observation probability in occasion t+1 assuming survival until that time,
juvenile size in occasion t+1 assuming survival and observation in that time, and
reproduction status in occasion t+1 assuming survival and observation until that time of a juvenile in occasion t that is becoming mature in occasion t+1.
The default settings for modelsearch estimate 1) survival probability, 3) size distribution, and 5) fecundity, which are the minimum 3 vital rates required for a full MPM. Observation probability (option obs in vitalrates) should only be included when a life history stage or size exists that cannot be observed. For example, in the case of a plant with vegetative dormancy, the observation probability can be thought of as the sprouting probability, which is a biologically meaningful vital rate (Shefferson et al. 2001). Further, reproduction status (option repst in vitalrates) should only be modeled if size classification needs to be stratified by the ability to reproduce, as when 0 fecundity occurs within stages that also produce offspring. Since Cypripedium candidum is capable of long bouts of vegetative dormancy, since we wish to stratify the population into reproductive and non-reproductive stages of the same size classes, and since we have no data derived from juvenile individuals, we will set vitalrates = c("surv", "obs", "size", "repst", "fec").
Third, we need to set the proper statistical distribution for each parameter. Survival probability, observation probability, and reproductive status are all modeled as binomial variables, and this cannot be changed. In the case of this population of Cypripedium candidum, size was measured as the number of stems and so is a count variable. Likewise, fecundity is actually estimated as the number of fruits produced per plant, and so is also a count variable. We have already performed tests for overdispersion and zero-inflation, and we are also aware that size in observed stages cannot be 0, requiring zero truncation in that parameter. So we will set size to the zero-truncated negative binomial distribution, and fecundity to the zero-inflated Poisson distribution.
Fourth, we need the proper model parameterizations for each vital rate, using the suite option. The default, suite = "main", under the mixed model setting (approach = "mixed") starts with the estimation of global models that include size and reproductive status in occasions t and t-1 as fixed factors, with individual identity and time in occasion t (year t) set as random categorical terms. Other terms can be specified, including individual covariates and age. Setting suite = "full" will yield global models that also include all two-way interactions. The global model under suite = "full" then includes all fixed factors noted before, plus time in occasion t and all two-way interactions between fixed factors (“full” is the only setting with interaction terms). If the population is not stratified by reproductive status, then suite = "size" will eliminate reproductive status terms and use all others in the global model. If size is not important, then suite = "rep" will eliminate size but keep reproductive status and all other terms. Finally, suite = "cons" will result in a global model in which neither reproductive status nor size are considered.
Finally, we need to determine the proper strategy for the determination of the best-fit model. Model building proceeds through the dredge function in package MuMIn (Bartoń 2014), and each model has an associated AICc value. The default setting in lefko3 (bestfit = "AICc&k") will compare all models within 2.0 AICc units of the model with \(\Delta AICc = 0\), and choose the one with the lowest degrees of freedom. This approach is generally better than the alternative, which simply uses the model with \(\Delta AICc = 0\) (bestfit = "AICc"), as all models within 2.0 AICc units of that model are equally parsimonious and so fewer degrees of freedom result from fewer parameters estimated (Burnham and Anderson 2002).
In the model building exercise below, we will use the suite = "main" option to run all main effects only. Normally we would set to suite = "full", but running all effects including their two-way interactions will likely tie up our computers for a few too many minutes. Once done, we can summarize the output with the summary() function.
cypmodels3p <- modelsearch(cypfb_v1, historical = TRUE, approach = "mixed",
vitalrates = c("surv", "obs", "size", "repst", "fec"), patch = "patchid",
sizedist = "negbin", size.trunc = TRUE, fecdist = "poisson", fec.zero = TRUE,
suite = "main", size = c("size3added", "size2added", "size1added"),
quiet = TRUE)
#> boundary (singular) fit: see ?isSingular
#> Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
#> Model failed to converge with max|grad| = 0.0213316 (tol = 0.002, component 1)
#> Warning in fitTMB(TMBStruc): Model convergence problem; false convergence (8).
#> See vignette('troubleshooting')
#> boundary (singular) fit: see ?isSingular
#> Warning in fitTMB(TMBStruc): Model convergence problem; non-positive-definite
#> Hessian matrix. See vignette('troubleshooting')
summary(cypmodels3p)
#> This LefkoMod object includes 5 linear models.
#> Best-fit model criterion used: AICc&k
#>
#> ────────────────────────────────────────────────────────────────────────────────
#> Survival model:
#> Generalized linear mixed model fit by maximum likelihood (Laplace
#> Approximation) [glmerMod]
#> Family: binomial ( logit )
#> Formula: alive3 ~ size2added + (1 | year2) + (1 | patchid) + (1 | individ)
#> Data: subdata
#> AIC BIC logLik deviance df.resid
#> 130.1321 148.9737 -60.0660 120.1321 315
#> Random effects:
#> Groups Name Std.Dev.
#> individ (Intercept) 1.199e+00
#> year2 (Intercept) 5.161e-05
#> patchid (Intercept) 1.113e-05
#> Number of obs: 320, groups: individ, 74; year2, 5; patchid, 3
#> Fixed Effects:
#> (Intercept) size2added
#> 2.0356 0.6343
#> optimizer (Nelder_Mead) convergence code: 0 (OK) ; 0 optimizer warnings; 1 lme4 warnings
#>
#> ────────────────────────────────────────
#>
#> Observation model:
#> Generalized linear mixed model fit by maximum likelihood (Laplace
#> Approximation) [glmerMod]
#> Family: binomial ( logit )
#> Formula: obsstatus3 ~ size2added + (1 | year2) + (1 | patchid) + (1 |
#> individ)
#> Data: subdata
#> AIC BIC logLik deviance df.resid
#> 120.2567 138.8254 -55.1284 110.2567 298
#> Random effects:
#> Groups Name Std.Dev.
#> individ (Intercept) 0.0000
#> year2 (Intercept) 0.8776
#> patchid (Intercept) 0.0000
#> Number of obs: 303, groups: individ, 70; year2, 5; patchid, 3
#> Fixed Effects:
#> (Intercept) size2added
#> 2.4904 0.3134
#> optimizer (Nelder_Mead) convergence code: 0 (OK) ; 0 optimizer warnings; 1 lme4 warnings
#>
#> ────────────────────────────────────────
#>
#> Size model:
#> Formula: size3added ~ size2added + (1 | year2) + (1 | patchid) + (1 |
#> individ)
#> Data: subdata
#> AIC BIC logLik df.resid
#> 1009.3168 1031.2946 -498.6584 282
#> Random-effects (co)variances:
#>
#> Conditional model:
#> Groups Name Std.Dev.
#> year2 (Intercept) 0.1215
#> patchid (Intercept) 0.2052
#> individ (Intercept) 0.9497
#>
#> Number of obs: 288 / Conditional model: year2, 5; patchid, 3; individ, 70
#>
#> Dispersion parameter for truncated_nbinom2 family (): 1.23e+09
#>
#> Fixed Effects:
#>
#> Conditional model:
#> (Intercept) size2added
#> 0.54038 0.02191
#>
#> ────────────────────────────────────────
#>
#> Reproductive status model:
#> Generalized linear mixed model fit by maximum likelihood (Laplace
#> Approximation) [glmerMod]
#> Family: binomial ( logit )
#> Formula: repstatus3 ~ repstatus2 + size2added + (1 | year2) + (1 | patchid) +
#> (1 | individ)
#> Data: subdata
#> AIC BIC logLik deviance df.resid
#> 333.4037 355.3815 -160.7019 321.4037 282
#> Random effects:
#> Groups Name Std.Dev.
#> individ (Intercept) 0.1776
#> year2 (Intercept) 0.6636
#> patchid (Intercept) 0.3501
#> Number of obs: 288, groups: individ, 70; year2, 5; patchid, 3
#> Fixed Effects:
#> (Intercept) repstatus2 size2added
#> -1.3836 1.5543 0.1788
#>
#> ────────────────────────────────────────
#>
#> Fecundity model:
#> Formula:
#> feca2 ~ size1added + size2added + (1 | year2) + (1 | patchid) +
#> (1 | individ)
#> Zero inflation:
#> ~size2added + (1 | year2) + (1 | patchid) + (1 | individ)
#> Data: subdata
#> AIC BIC logLik df.resid
#> 252.3835 282.8610 -115.1917 107
#> Random-effects (co)variances:
#>
#> Conditional model:
#> Groups Name Std.Dev.
#> year2 (Intercept) 6.043e-01
#> patchid (Intercept) 2.130e-01
#> individ (Intercept) 5.213e-10
#>
#> Zero-inflation model:
#> Groups Name Std.Dev.
#> year2 (Intercept) 4.136e-12
#> patchid (Intercept) 1.460e-13
#> individ (Intercept) 2.951e-04
#>
#> Number of obs: 118 / Conditional model: year2, 5; patchid, 3; individ, 51 / Zero-inflation model: year2, 5; patchid, 3; individ, 51
#>
#> Fixed Effects:
#>
#> Conditional model:
#> (Intercept) size1added size2added
#> -0.51758 -0.03543 0.08305
#>
#> Zero-inflation model:
#> (Intercept) size2added
#> 3.857 -1.575
#>
#> ────────────────────────────────────────────────────────────────────────────────
#> Juvenile survival model:
#> [1] 1
#>
#> ────────────────────────────────────────
#>
#> Juvenile observation model:
#> [1] 1
#>
#> ────────────────────────────────────────
#>
#> Juvenile size model:
#> [1] 1
#>
#> ────────────────────────────────────────
#>
#> Juvenile reproduction model:
#> [1] 1
#>
#>
#> ────────────────────────────────────────────────────────────────────────────────
#>
#> Number of models in survival table:16
#>
#> Number of models in observation table:16
#>
#> Number of models in size table:16
#>
#> Number of models in reproduction status table:16
#>
#> Number of models in fecundity table:57
#>
#> Number of models in juvenile survival table: 1
#>
#> Number of models in juvenile observation table: 1
#>
#> Number of models in juvenile size table: 1
#>
#> Number of models in juvenile reproduction table: 1
#>
#>
#> ────────────────────────────────────────────────────────────────────────────────
#>
#> General model parameter names (column 1), and specific names used in these models (column 2):
#> parameter_names mainparams
#> 1 time t year2
#> 2 individual individ
#> 3 patch patch
#> 4 alive in time t+1 surv3
#> 5 observed in time t+1 obs3
#> 6 size in time t+1 size3
#> 7 reproductive status in time t+1 repst3
#> 8 fecundity in time t+1 fec3
#> 9 fecundity in time t fec2
#> 10 size in time t size2
#> 11 size in time t-1 size1
#> 12 reproductive status in time t repst2
#> 13 reprodutive status in time t-1 repst1
#> 14 age in time t age
#> 15 individual covariate a in time t indcova2
#> 16 individual covariate a in time t-1 indcova1
#> 17 individual covariate b in time t indcovb2
#> 18 individual covariate b in time t-1 indcovb1
#> 19 individual covariate c in time t indcovc2
#> 20 individual covariate c in time t-1 indcovc1
#>
#>
#> ────────────────────────────────────────────────────────────────────────────────
#>
#> Quality control:
#>
#> Survival estimated with 74 individuals and 320 individual transitions.
#> Observation estimated with 70 individuals and 303 individual transitions.
#> Size estimated with 70 individuals and 288 individual transitions.
#> Reproductive status estimated with 70 individuals and 288 individual transitions.
#> Fecundity estimated with 51 individuals and 118 individual transitions.
#> Juvenile survival not estimated.
#> Juvenile observation probability not estimated.
#> Juvenile size transition not estimated.
#> Juvenile reproduction probability not estimated.
#> NULL
We can see that historical size is included in the best-fit fecundity model. This suggests that the historical MPM is the most parsimonious choice. However, in order to compare MPMs for educational purposes, we will also create an ahistorical model set. Note that a vital rate model set that includes historical terms CANNOT be used to make an ahistorical MPM. Here is an ahistorical model set.
cypmodels2p <- modelsearch(cypfb_v1, historical = FALSE, approach = "mixed",
vitalrates = c("surv", "obs", "size", "repst", "fec"), patch = "patchid",
sizedist = "negbin", size.trunc = TRUE, fecdist = "poisson", fec.zero = TRUE,
suite = "main", size = c("size3added", "size2added", "size1added"),
quiet = TRUE)
#> boundary (singular) fit: see ?isSingular
#> boundary (singular) fit: see ?isSingular
#> Warning in fitTMB(TMBStruc): Model convergence problem; false convergence (8).
#> See vignette('troubleshooting')
#> Warning in fitTMB(TMBStruc): Model convergence problem; non-positive-definite
#> Hessian matrix. See vignette('troubleshooting')
summary(cypmodels2p)
#> This LefkoMod object includes 5 linear models.
#> Best-fit model criterion used: AICc&k
#>
#> ────────────────────────────────────────────────────────────────────────────────
#> Survival model:
#> Generalized linear mixed model fit by maximum likelihood (Laplace
#> Approximation) [glmerMod]
#> Family: binomial ( logit )
#> Formula: alive3 ~ size2added + (1 | year2) + (1 | patchid) + (1 | individ)
#> Data: subdata
#> AIC BIC logLik deviance df.resid
#> 130.1321 148.9737 -60.0660 120.1321 315
#> Random effects:
#> Groups Name Std.Dev.
#> individ (Intercept) 1.199e+00
#> year2 (Intercept) 5.161e-05
#> patchid (Intercept) 1.113e-05
#> Number of obs: 320, groups: individ, 74; year2, 5; patchid, 3
#> Fixed Effects:
#> (Intercept) size2added
#> 2.0356 0.6343
#> optimizer (Nelder_Mead) convergence code: 0 (OK) ; 0 optimizer warnings; 1 lme4 warnings
#>
#> ────────────────────────────────────────
#>
#> Observation model:
#> Generalized linear mixed model fit by maximum likelihood (Laplace
#> Approximation) [glmerMod]
#> Family: binomial ( logit )
#> Formula: obsstatus3 ~ size2added + (1 | year2) + (1 | patchid) + (1 |
#> individ)
#> Data: subdata
#> AIC BIC logLik deviance df.resid
#> 120.2567 138.8254 -55.1284 110.2567 298
#> Random effects:
#> Groups Name Std.Dev.
#> individ (Intercept) 0.0000
#> year2 (Intercept) 0.8776
#> patchid (Intercept) 0.0000
#> Number of obs: 303, groups: individ, 70; year2, 5; patchid, 3
#> Fixed Effects:
#> (Intercept) size2added
#> 2.4904 0.3134
#> optimizer (Nelder_Mead) convergence code: 0 (OK) ; 0 optimizer warnings; 1 lme4 warnings
#>
#> ────────────────────────────────────────
#>
#> Size model:
#> Formula: size3added ~ size2added + (1 | year2) + (1 | patchid) + (1 |
#> individ)
#> Data: subdata
#> AIC BIC logLik df.resid
#> 1009.3168 1031.2946 -498.6584 282
#> Random-effects (co)variances:
#>
#> Conditional model:
#> Groups Name Std.Dev.
#> year2 (Intercept) 0.1215
#> patchid (Intercept) 0.2052
#> individ (Intercept) 0.9497
#>
#> Number of obs: 288 / Conditional model: year2, 5; patchid, 3; individ, 70
#>
#> Dispersion parameter for truncated_nbinom2 family (): 1.23e+09
#>
#> Fixed Effects:
#>
#> Conditional model:
#> (Intercept) size2added
#> 0.54038 0.02191
#>
#> ────────────────────────────────────────
#>
#> Reproductive status model:
#> Generalized linear mixed model fit by maximum likelihood (Laplace
#> Approximation) [glmerMod]
#> Family: binomial ( logit )
#> Formula: repstatus3 ~ repstatus2 + size2added + (1 | year2) + (1 | patchid) +
#> (1 | individ)
#> Data: subdata
#> AIC BIC logLik deviance df.resid
#> 333.4037 355.3815 -160.7019 321.4037 282
#> Random effects:
#> Groups Name Std.Dev.
#> individ (Intercept) 0.1776
#> year2 (Intercept) 0.6636
#> patchid (Intercept) 0.3501
#> Number of obs: 288, groups: individ, 70; year2, 5; patchid, 3
#> Fixed Effects:
#> (Intercept) repstatus2 size2added
#> -1.3836 1.5543 0.1788
#>
#> ────────────────────────────────────────
#>
#> Fecundity model:
#> Formula: feca2 ~ (1 | year2) + (1 | patchid) + (1 | individ)
#> Zero inflation:
#> ~size2added + (1 | year2) + (1 | patchid) + (1 | individ)
#> Data: subdata
#> AIC BIC logLik df.resid
#> 256.6460 281.5822 -119.3230 109
#> Random-effects (co)variances:
#>
#> Conditional model:
#> Groups Name Std.Dev.
#> year2 (Intercept) 0.5908
#> patchid (Intercept) 0.1970
#> individ (Intercept) 0.3863
#>
#> Zero-inflation model:
#> Groups Name Std.Dev.
#> year2 (Intercept) 2.458e-08
#> patchid (Intercept) 3.189e-07
#> individ (Intercept) 2.445e-04
#>
#> Number of obs: 118 / Conditional model: year2, 5; patchid, 3; individ, 51 / Zero-inflation model: year2, 5; patchid, 3; individ, 51
#>
#> Fixed Effects:
#>
#> Conditional model:
#> (Intercept)
#> -0.2146
#>
#> Zero-inflation model:
#> (Intercept) size2added
#> 4.081 -1.597
#>
#> ────────────────────────────────────────────────────────────────────────────────
#> Juvenile survival model:
#> [1] 1
#>
#> ────────────────────────────────────────
#>
#> Juvenile observation model:
#> [1] 1
#>
#> ────────────────────────────────────────
#>
#> Juvenile size model:
#> [1] 1
#>
#> ────────────────────────────────────────
#>
#> Juvenile reproduction model:
#> [1] 1
#>
#>
#> ────────────────────────────────────────────────────────────────────────────────
#>
#> Number of models in survival table:4
#>
#> Number of models in observation table:4
#>
#> Number of models in size table:4
#>
#> Number of models in reproduction status table:4
#>
#> Number of models in fecundity table:3
#>
#> Number of models in juvenile survival table: 1
#>
#> Number of models in juvenile observation table: 1
#>
#> Number of models in juvenile size table: 1
#>
#> Number of models in juvenile reproduction table: 1
#>
#>
#> ────────────────────────────────────────────────────────────────────────────────
#>
#> General model parameter names (column 1), and specific names used in these models (column 2):
#> parameter_names mainparams
#> 1 time t year2
#> 2 individual individ
#> 3 patch patch
#> 4 alive in time t+1 surv3
#> 5 observed in time t+1 obs3
#> 6 size in time t+1 size3
#> 7 reproductive status in time t+1 repst3
#> 8 fecundity in time t+1 fec3
#> 9 fecundity in time t fec2
#> 10 size in time t size2
#> 11 size in time t-1 size1
#> 12 reproductive status in time t repst2
#> 13 reprodutive status in time t-1 repst1
#> 14 age in time t age
#> 15 individual covariate a in time t indcova2
#> 16 individual covariate a in time t-1 indcova1
#> 17 individual covariate b in time t indcovb2
#> 18 individual covariate b in time t-1 indcovb1
#> 19 individual covariate c in time t indcovc2
#> 20 individual covariate c in time t-1 indcovc1
#>
#>
#> ────────────────────────────────────────────────────────────────────────────────
#>
#> Quality control:
#>
#> Survival estimated with 74 individuals and 320 individual transitions.
#> Observation estimated with 70 individuals and 303 individual transitions.
#> Size estimated with 70 individuals and 288 individual transitions.
#> Reproductive status estimated with 70 individuals and 288 individual transitions.
#> Fecundity estimated with 51 individuals and 118 individual transitions.
#> Juvenile survival not estimated.
#> Juvenile observation probability not estimated.
#> Juvenile size transition not estimated.
#> Juvenile reproduction probability not estimated.
#> NULL
In the preceding vital rate model sets, we created best-fit models that necessarily included a patch term. This will result necessarily in the creation of matrices at the patch level. To create matrices for the population level only, we remove the patch option from the preceding function calls, as below.
cypmodels3 <- modelsearch(cypfb_v1, historical = TRUE, approach = "mixed",
vitalrates = c("surv", "obs", "size", "repst", "fec"),
sizedist = "negbin", size.trunc = TRUE, fecdist = "poisson", fec.zero = TRUE,
suite = "main", size = c("size3added", "size2added", "size1added"),
quiet = TRUE)
#> boundary (singular) fit: see ?isSingular
#> boundary (singular) fit: see ?isSingular
#> Warning in fitTMB(TMBStruc): Model convergence problem; non-positive-definite
#> Hessian matrix. See vignette('troubleshooting')
cypmodels2 <- modelsearch(cypfb_v1, historical = FALSE, approach = "mixed",
vitalrates = c("surv", "obs", "size", "repst", "fec"),
sizedist = "negbin", size.trunc = TRUE, fecdist = "poisson", fec.zero = TRUE,
suite = "main", size = c("size3added", "size2added"),
quiet = TRUE)
#> boundary (singular) fit: see ?isSingular
#> Warning in fitTMB(TMBStruc): Model convergence problem; non-positive-definite
#> Hessian matrix. See vignette('troubleshooting')
#> Warning in fitTMB(TMBStruc): Model convergence problem; false convergence (8).
#> See vignette('troubleshooting')
summary(cypmodels3)
#> This LefkoMod object includes 5 linear models.
#> Best-fit model criterion used: AICc&k
#>
#> ────────────────────────────────────────────────────────────────────────────────
#> Survival model:
#> Generalized linear mixed model fit by maximum likelihood (Laplace
#> Approximation) [glmerMod]
#> Family: binomial ( logit )
#> Formula: alive3 ~ size2added + (1 | year2) + (1 | individ)
#> Data: subdata
#> AIC BIC logLik deviance df.resid
#> 128.1324 143.2057 -60.0662 120.1324 316
#> Random effects:
#> Groups Name Std.Dev.
#> individ (Intercept) 1.198361
#> year2 (Intercept) 0.008826
#> Number of obs: 320, groups: individ, 74; year2, 5
#> Fixed Effects:
#> (Intercept) size2added
#> 2.0352 0.6344
#> optimizer (Nelder_Mead) convergence code: 0 (OK) ; 0 optimizer warnings; 1 lme4 warnings
#>
#> ────────────────────────────────────────
#>
#> Observation model:
#> Generalized linear mixed model fit by maximum likelihood (Laplace
#> Approximation) [glmerMod]
#> Family: binomial ( logit )
#> Formula: obsstatus3 ~ size2added + (1 | year2) + (1 | individ)
#> Data: subdata
#> AIC BIC logLik deviance df.resid
#> 118.2567 133.1117 -55.1284 110.2567 299
#> Random effects:
#> Groups Name Std.Dev.
#> individ (Intercept) 1.078e-05
#> year2 (Intercept) 8.776e-01
#> Number of obs: 303, groups: individ, 70; year2, 5
#> Fixed Effects:
#> (Intercept) size2added
#> 2.4904 0.3134
#> optimizer (Nelder_Mead) convergence code: 0 (OK) ; 0 optimizer warnings; 1 lme4 warnings
#>
#> ────────────────────────────────────────
#>
#> Size model:
#> Formula: size3added ~ (1 | year2) + (1 | individ)
#> Data: subdata
#> AIC BIC logLik df.resid
#> 1008.2748 1022.9266 -500.1374 284
#> Random-effects (co)variances:
#>
#> Conditional model:
#> Groups Name Std.Dev.
#> year2 (Intercept) 0.1109
#> individ (Intercept) 1.0562
#>
#> Number of obs: 288 / Conditional model: year2, 5; individ, 70
#>
#> Dispersion parameter for truncated_nbinom2 family (): 9.81e+08
#>
#> Fixed Effects:
#>
#> Conditional model:
#> (Intercept)
#> 0.576
#>
#> ────────────────────────────────────────
#>
#> Reproductive status model:
#> Generalized linear mixed model fit by maximum likelihood (Laplace
#> Approximation) [glmerMod]
#> Family: binomial ( logit )
#> Formula: repstatus3 ~ repstatus2 + size2added + (1 | year2) + (1 | individ)
#> Data: subdata
#> AIC BIC logLik deviance df.resid
#> 333.6176 351.9324 -161.8088 323.6176 283
#> Random effects:
#> Groups Name Std.Dev.
#> individ (Intercept) 0.1829
#> year2 (Intercept) 0.6250
#> Number of obs: 288, groups: individ, 70; year2, 5
#> Fixed Effects:
#> (Intercept) repstatus2 size2added
#> -1.4630 1.6457 0.1715
#>
#> ────────────────────────────────────────
#>
#> Fecundity model:
#> Formula: feca2 ~ size2added + (1 | year2) + (1 | individ)
#> Zero inflation: ~size2added + (1 | year2) + (1 | individ)
#> Data: subdata
#> AIC BIC logLik df.resid
#> 248.8609 271.0264 -116.4305 110
#> Random-effects (co)variances:
#>
#> Conditional model:
#> Groups Name Std.Dev.
#> year2 (Intercept) 0.5760
#> individ (Intercept) 0.1639
#>
#> Zero-inflation model:
#> Groups Name Std.Dev.
#> year2 (Intercept) 1.642e-06
#> individ (Intercept) 3.089e-04
#>
#> Number of obs: 118 / Conditional model: year2, 5; individ, 51 / Zero-inflation model: year2, 5; individ, 51
#>
#> Fixed Effects:
#>
#> Conditional model:
#> (Intercept) size2added
#> -0.54014 0.06174
#>
#> Zero-inflation model:
#> (Intercept) size2added
#> 3.865 -1.574
#>
#> ────────────────────────────────────────────────────────────────────────────────
#> Juvenile survival model:
#> [1] 1
#>
#> ────────────────────────────────────────
#>
#> Juvenile observation model:
#> [1] 1
#>
#> ────────────────────────────────────────
#>
#> Juvenile size model:
#> [1] 1
#>
#> ────────────────────────────────────────
#>
#> Juvenile reproduction model:
#> [1] 1
#>
#>
#> ────────────────────────────────────────────────────────────────────────────────
#>
#> Number of models in survival table:16
#>
#> Number of models in observation table:16
#>
#> Number of models in size table:16
#>
#> Number of models in reproduction status table:16
#>
#> Number of models in fecundity table:58
#>
#> Number of models in juvenile survival table: 1
#>
#> Number of models in juvenile observation table: 1
#>
#> Number of models in juvenile size table: 1
#>
#> Number of models in juvenile reproduction table: 1
#>
#>
#> ────────────────────────────────────────────────────────────────────────────────
#>
#> General model parameter names (column 1), and specific names used in these models (column 2):
#> parameter_names mainparams
#> 1 time t year2
#> 2 individual individ
#> 3 patch patch
#> 4 alive in time t+1 surv3
#> 5 observed in time t+1 obs3
#> 6 size in time t+1 size3
#> 7 reproductive status in time t+1 repst3
#> 8 fecundity in time t+1 fec3
#> 9 fecundity in time t fec2
#> 10 size in time t size2
#> 11 size in time t-1 size1
#> 12 reproductive status in time t repst2
#> 13 reprodutive status in time t-1 repst1
#> 14 age in time t age
#> 15 individual covariate a in time t indcova2
#> 16 individual covariate a in time t-1 indcova1
#> 17 individual covariate b in time t indcovb2
#> 18 individual covariate b in time t-1 indcovb1
#> 19 individual covariate c in time t indcovc2
#> 20 individual covariate c in time t-1 indcovc1
#>
#>
#> ────────────────────────────────────────────────────────────────────────────────
#>
#> Quality control:
#>
#> Survival estimated with 74 individuals and 320 individual transitions.
#> Observation estimated with 70 individuals and 303 individual transitions.
#> Size estimated with 70 individuals and 288 individual transitions.
#> Reproductive status estimated with 70 individuals and 288 individual transitions.
#> Fecundity estimated with 51 individuals and 118 individual transitions.
#> Juvenile survival not estimated.
#> Juvenile observation probability not estimated.
#> Juvenile size transition not estimated.
#> Juvenile reproduction probability not estimated.
#> NULL
summary(cypmodels2)
#> This LefkoMod object includes 5 linear models.
#> Best-fit model criterion used: AICc&k
#>
#> ────────────────────────────────────────────────────────────────────────────────
#> Survival model:
#> Generalized linear mixed model fit by maximum likelihood (Laplace
#> Approximation) [glmerMod]
#> Family: binomial ( logit )
#> Formula: alive3 ~ size2added + (1 | year2) + (1 | individ)
#> Data: subdata
#> AIC BIC logLik deviance df.resid
#> 128.1324 143.2057 -60.0662 120.1324 316
#> Random effects:
#> Groups Name Std.Dev.
#> individ (Intercept) 1.198361
#> year2 (Intercept) 0.008826
#> Number of obs: 320, groups: individ, 74; year2, 5
#> Fixed Effects:
#> (Intercept) size2added
#> 2.0352 0.6344
#> optimizer (Nelder_Mead) convergence code: 0 (OK) ; 0 optimizer warnings; 1 lme4 warnings
#>
#> ────────────────────────────────────────
#>
#> Observation model:
#> Generalized linear mixed model fit by maximum likelihood (Laplace
#> Approximation) [glmerMod]
#> Family: binomial ( logit )
#> Formula: obsstatus3 ~ size2added + (1 | year2) + (1 | individ)
#> Data: subdata
#> AIC BIC logLik deviance df.resid
#> 118.2567 133.1117 -55.1284 110.2567 299
#> Random effects:
#> Groups Name Std.Dev.
#> individ (Intercept) 1.078e-05
#> year2 (Intercept) 8.776e-01
#> Number of obs: 303, groups: individ, 70; year2, 5
#> Fixed Effects:
#> (Intercept) size2added
#> 2.4904 0.3134
#> optimizer (Nelder_Mead) convergence code: 0 (OK) ; 0 optimizer warnings; 1 lme4 warnings
#>
#> ────────────────────────────────────────
#>
#> Size model:
#> Formula: size3added ~ (1 | year2) + (1 | individ)
#> Data: subdata
#> AIC BIC logLik df.resid
#> 1008.2748 1022.9266 -500.1374 284
#> Random-effects (co)variances:
#>
#> Conditional model:
#> Groups Name Std.Dev.
#> year2 (Intercept) 0.1109
#> individ (Intercept) 1.0562
#>
#> Number of obs: 288 / Conditional model: year2, 5; individ, 70
#>
#> Dispersion parameter for truncated_nbinom2 family (): 9.81e+08
#>
#> Fixed Effects:
#>
#> Conditional model:
#> (Intercept)
#> 0.576
#>
#> ────────────────────────────────────────
#>
#> Reproductive status model:
#> Generalized linear mixed model fit by maximum likelihood (Laplace
#> Approximation) [glmerMod]
#> Family: binomial ( logit )
#> Formula: repstatus3 ~ repstatus2 + size2added + (1 | year2) + (1 | individ)
#> Data: subdata
#> AIC BIC logLik deviance df.resid
#> 333.6176 351.9324 -161.8088 323.6176 283
#> Random effects:
#> Groups Name Std.Dev.
#> individ (Intercept) 0.1829
#> year2 (Intercept) 0.6250
#> Number of obs: 288, groups: individ, 70; year2, 5
#> Fixed Effects:
#> (Intercept) repstatus2 size2added
#> -1.4630 1.6457 0.1715
#>
#> ────────────────────────────────────────
#>
#> Fecundity model:
#> Formula: feca2 ~ size2added + (1 | year2) + (1 | individ)
#> Zero inflation: ~size2added + (1 | year2) + (1 | individ)
#> Data: subdata
#> AIC BIC logLik df.resid
#> 248.8609 271.0264 -116.4305 110
#> Random-effects (co)variances:
#>
#> Conditional model:
#> Groups Name Std.Dev.
#> year2 (Intercept) 0.5760
#> individ (Intercept) 0.1639
#>
#> Zero-inflation model:
#> Groups Name Std.Dev.
#> year2 (Intercept) 1.642e-06
#> individ (Intercept) 3.089e-04
#>
#> Number of obs: 118 / Conditional model: year2, 5; individ, 51 / Zero-inflation model: year2, 5; individ, 51
#>
#> Fixed Effects:
#>
#> Conditional model:
#> (Intercept) size2added
#> -0.54014 0.06174
#>
#> Zero-inflation model:
#> (Intercept) size2added
#> 3.865 -1.574
#>
#> ────────────────────────────────────────────────────────────────────────────────
#> Juvenile survival model:
#> [1] 1
#>
#> ────────────────────────────────────────
#>
#> Juvenile observation model:
#> [1] 1
#>
#> ────────────────────────────────────────
#>
#> Juvenile size model:
#> [1] 1
#>
#> ────────────────────────────────────────
#>
#> Juvenile reproduction model:
#> [1] 1
#>
#>
#> ────────────────────────────────────────────────────────────────────────────────
#>
#> Number of models in survival table:4
#>
#> Number of models in observation table:4
#>
#> Number of models in size table:4
#>
#> Number of models in reproduction status table:4
#>
#> Number of models in fecundity table:3
#>
#> Number of models in juvenile survival table: 1
#>
#> Number of models in juvenile observation table: 1
#>
#> Number of models in juvenile size table: 1
#>
#> Number of models in juvenile reproduction table: 1
#>
#>
#> ────────────────────────────────────────────────────────────────────────────────
#>
#> General model parameter names (column 1), and specific names used in these models (column 2):
#> parameter_names mainparams
#> 1 time t year2
#> 2 individual individ
#> 3 patch patch
#> 4 alive in time t+1 surv3
#> 5 observed in time t+1 obs3
#> 6 size in time t+1 size3
#> 7 reproductive status in time t+1 repst3
#> 8 fecundity in time t+1 fec3
#> 9 fecundity in time t fec2
#> 10 size in time t size2
#> 11 size in time t-1 size1
#> 12 reproductive status in time t repst2
#> 13 reprodutive status in time t-1 repst1
#> 14 age in time t age
#> 15 individual covariate a in time t indcova2
#> 16 individual covariate a in time t-1 indcova1
#> 17 individual covariate b in time t indcovb2
#> 18 individual covariate b in time t-1 indcovb1
#> 19 individual covariate c in time t indcovc2
#> 20 individual covariate c in time t-1 indcovc1
#>
#>
#> ────────────────────────────────────────────────────────────────────────────────
#>
#> Quality control:
#>
#> Survival estimated with 74 individuals and 320 individual transitions.
#> Observation estimated with 70 individuals and 303 individual transitions.
#> Size estimated with 70 individuals and 288 individual transitions.
#> Reproductive status estimated with 70 individuals and 288 individual transitions.
#> Fecundity estimated with 51 individuals and 118 individual transitions.
#> Juvenile survival not estimated.
#> Juvenile observation probability not estimated.
#> Juvenile size transition not estimated.
#> Juvenile reproduction probability not estimated.
#> NULL
Note that we now have no patch term in any model, and some of our models have changed in other ways as well.
We will now proceed to create our matrices. Since we have determined that individual history is important, we could settle for simply producing a historical MPM. However, we will produce both historical and ahistorical MPMs for comparison, and we will also produce these in both raw and function-based formats.
We will begin with the creation of a set of ahistorical matrices for the Cypripedium candidum dataset. The rlefko2 function was created to deal with the construction of ahistorical MPMs using raw data. Matrices may strongly differ, particularly if the demographic dataset is somewhat sparse. This happens because there may not be enough individuals per year to encounter all possible transitions, leading to seemingly random shifts in the location of non-zero elements within matrices across time. We strongly advise readers to build life history models that reflect the sample size that they are working with to prevent this issue from causing odd results in MPM analysis.
cypmatrix2rp <- rlefko2(data = cypraw_v1, stageframe = cypframe_raw,
year = "all", patch = "all", stages = c("stage3", "stage2"),
size = c("size3added", "size2added"), supplement = cypsupp2_raw,
yearcol = "year2", patchcol = "patchid", indivcol = "individ")
cypmatrix2rp
#> $A
#> $A$`1`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> [1,] 0.03 0.0 0.0 0.0 0.0000000 0 0.0000000 500.0 1666.6666667 0
#> [2,] 0.15 0.0 0.0 0.0 0.0000000 0 0.0000000 500.0 1666.6666667 0
#> [3,] 0.00 0.1 0.0 0.0 0.0000000 0 0.0000000 0.0 0.0000000 0
#> [4,] 0.00 0.0 0.1 0.0 0.0000000 0 0.0000000 0.0 0.0000000 0
#> [5,] 0.00 0.0 0.0 0.1 0.0500000 0 0.0000000 0.0 0.0000000 0
#> [6,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0 0.0000000 0
#> [7,] 0.00 0.0 0.0 0.0 0.6363636 0 0.6363636 0.2 0.0000000 0
#> [8,] 0.00 0.0 0.0 0.0 0.0000000 0 0.2727273 0.6 0.6666667 1
#> [9,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.2 0.3333333 0
#> [10,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0 0.0000000 0
#> [11,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0 0.0000000 0
#> [,11]
#> [1,] 0
#> [2,] 0
#> [3,] 0
#> [4,] 0
#> [5,] 0
#> [6,] 0
#> [7,] 0
#> [8,] 0
#> [9,] 0
#> [10,] 0
#> [11,] 0
#>
#> $A$`2`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0.03 0.0 0.0 0.0 0.000 0 312.500 1111.1111111 1250 0 0
#> [2,] 0.15 0.0 0.0 0.0 0.000 0 312.500 1111.1111111 1250 0 0
#> [3,] 0.00 0.1 0.0 0.0 0.000 0 0.000 0.0000000 0 0 0
#> [4,] 0.00 0.0 0.1 0.0 0.000 0 0.000 0.0000000 0 0 0
#> [5,] 0.00 0.0 0.0 0.1 0.050 0 0.000 0.0000000 0 0 0
#> [6,] 0.00 0.0 0.0 0.0 0.125 0 0.125 0.0000000 0 0 0
#> [7,] 0.00 0.0 0.0 0.0 0.750 0 0.750 0.3333333 0 0 0
#> [8,] 0.00 0.0 0.0 0.0 0.000 0 0.000 0.4444444 0 0 0
#> [9,] 0.00 0.0 0.0 0.0 0.000 0 0.000 0.2222222 1 0 0
#> [10,] 0.00 0.0 0.0 0.0 0.000 0 0.000 0.0000000 0 0 0
#> [11,] 0.00 0.0 0.0 0.0 0.000 0 0.000 0.0000000 0 0 0
#>
#> $A$`3`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0.03 0.0 0.0 0.0 0.0000000 0 0.0000000 0 0.00 0 0
#> [2,] 0.15 0.0 0.0 0.0 0.0000000 0 0.0000000 0 0.00 0 0
#> [3,] 0.00 0.1 0.0 0.0 0.0000000 0 0.0000000 0 0.00 0 0
#> [4,] 0.00 0.0 0.1 0.0 0.0000000 0 0.0000000 0 0.00 0 0
#> [5,] 0.00 0.0 0.0 0.1 0.0500000 0 0.0000000 0 0.00 0 0
#> [6,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0 0.00 0 0
#> [7,] 0.00 0.0 0.0 0.0 0.6666667 0 0.6666667 0 0.00 0 0
#> [8,] 0.00 0.0 0.0 0.0 0.0000000 1 0.3333333 1 0.25 0 0
#> [9,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0 0.75 0 0
#> [10,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0 0.00 0 0
#> [11,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0 0.00 0 0
#>
#> $A$`4`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> [1,] 0.03 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0
#> [2,] 0.15 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0
#> [3,] 0.00 0.1 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0
#> [4,] 0.00 0.0 0.1 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0
#> [5,] 0.00 0.0 0.0 0.1 0.0500000 0 0.0000000 0.0000000 0.0000000 0
#> [6,] 0.00 0.0 0.0 0.0 0.1666667 0 0.1666667 0.2222222 0.0000000 0
#> [7,] 0.00 0.0 0.0 0.0 0.5000000 0 0.5000000 0.4444444 0.3333333 0
#> [8,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.3333333 0.3333333 0
#> [9,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.3333333 0
#> [10,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0
#> [11,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0
#> [,11]
#> [1,] 0
#> [2,] 0
#> [3,] 0
#> [4,] 0
#> [5,] 0
#> [6,] 0
#> [7,] 0
#> [8,] 0
#> [9,] 0
#> [10,] 0
#> [11,] 0
#>
#> $A$`5`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0.03 0.0 0.0 0.0 0.0000000 0.0000000 0.0000000 500.0 5000 0 0
#> [2,] 0.15 0.0 0.0 0.0 0.0000000 0.0000000 0.0000000 500.0 5000 0 0
#> [3,] 0.00 0.1 0.0 0.0 0.0000000 0.0000000 0.0000000 0.0 0 0 0
#> [4,] 0.00 0.0 0.1 0.0 0.0000000 0.0000000 0.0000000 0.0 0 0 0
#> [5,] 0.00 0.0 0.0 0.1 0.0500000 0.0000000 0.0000000 0.0 0 0 0
#> [6,] 0.00 0.0 0.0 0.0 0.0000000 0.0000000 0.0000000 0.0 0 0 0
#> [7,] 0.00 0.0 0.0 0.0 0.4444444 0.3333333 0.4444444 0.0 0 0 0
#> [8,] 0.00 0.0 0.0 0.0 0.0000000 0.6666667 0.4444444 0.6 0 0 0
#> [9,] 0.00 0.0 0.0 0.0 0.0000000 0.0000000 0.0000000 0.0 0 0 0
#> [10,] 0.00 0.0 0.0 0.0 0.0000000 0.0000000 0.0000000 0.0 1 0 0
#> [11,] 0.00 0.0 0.0 0.0 0.0000000 0.0000000 0.0000000 0.0 0 0 0
#>
#> $A$`6`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> [1,] 0.03 0.0 0.0 0.0 0.0000000 0 0.0000000 166.6666667 625.00 1875.00
#> [2,] 0.15 0.0 0.0 0.0 0.0000000 0 0.0000000 166.6666667 625.00 1875.00
#> [3,] 0.00 0.1 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.00 0.00
#> [4,] 0.00 0.0 0.1 0.0 0.0000000 0 0.0000000 0.0000000 0.00 0.00
#> [5,] 0.00 0.0 0.0 0.1 0.0500000 0 0.0000000 0.0000000 0.00 0.00
#> [6,] 0.00 0.0 0.0 0.0 0.1111111 0 0.1111111 0.0000000 0.00 0.00
#> [7,] 0.00 0.0 0.0 0.0 0.6666667 0 0.6666667 0.2666667 0.00 0.00
#> [8,] 0.00 0.0 0.0 0.0 0.0000000 0 0.1111111 0.6000000 0.50 0.00
#> [9,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.1333333 0.25 0.25
#> [10,] 0.00 0.0 0.0 0.0 0.0000000 0 0.1111111 0.0000000 0.25 0.50
#> [11,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.00 0.25
#> [,11]
#> [1,] 0
#> [2,] 0
#> [3,] 0
#> [4,] 0
#> [5,] 0
#> [6,] 0
#> [7,] 0
#> [8,] 0
#> [9,] 0
#> [10,] 0
#> [11,] 0
#>
#> $A$`7`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
#> [1,] 0.03 0.0 0.0 0.0 0.00000000 0 0.00000000 1.666667e+03 4375.00
#> [2,] 0.15 0.0 0.0 0.0 0.00000000 0 0.00000000 1.666667e+03 4375.00
#> [3,] 0.00 0.1 0.0 0.0 0.00000000 0 0.00000000 0.000000e+00 0.00
#> [4,] 0.00 0.0 0.1 0.0 0.00000000 0 0.00000000 0.000000e+00 0.00
#> [5,] 0.00 0.0 0.0 0.1 0.05000000 0 0.00000000 0.000000e+00 0.00
#> [6,] 0.00 0.0 0.0 0.0 0.09090909 0 0.09090909 8.333333e-02 0.00
#> [7,] 0.00 0.0 0.0 0.0 0.45454545 0 0.45454545 2.500000e-01 0.25
#> [8,] 0.00 0.0 0.0 0.0 0.00000000 1 0.36363636 5.833333e-01 0.50
#> [9,] 0.00 0.0 0.0 0.0 0.00000000 0 0.00000000 0.000000e+00 0.25
#> [10,] 0.00 0.0 0.0 0.0 0.00000000 0 0.00000000 0.000000e+00 0.00
#> [11,] 0.00 0.0 0.0 0.0 0.00000000 0 0.00000000 0.000000e+00 0.00
#> [,10] [,11]
#> [1,] 5000.00 17500
#> [2,] 5000.00 17500
#> [3,] 0.00 0
#> [4,] 0.00 0
#> [5,] 0.00 0
#> [6,] 0.00 0
#> [7,] 0.00 0
#> [8,] 0.50 0
#> [9,] 0.25 0
#> [10,] 0.25 0
#> [11,] 0.00 1
#>
#> $A$`8`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> [1,] 0.03 0.0 0.0 0.0 0.0000000 0 277.7777778 781.2500 6250.0 5000
#> [2,] 0.15 0.0 0.0 0.0 0.0000000 0 277.7777778 781.2500 6250.0 5000
#> [3,] 0.00 0.1 0.0 0.0 0.0000000 0 0.0000000 0.0000 0.0 0
#> [4,] 0.00 0.0 0.1 0.0 0.0000000 0 0.0000000 0.0000 0.0 0
#> [5,] 0.00 0.0 0.0 0.1 0.0500000 0 0.0000000 0.0000 0.0 0
#> [6,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.1875 0.0 0
#> [7,] 0.00 0.0 0.0 0.0 0.3333333 1 0.3333333 0.3125 0.0 0
#> [8,] 0.00 0.0 0.0 0.0 0.0000000 0 0.3333333 0.3750 0.5 0
#> [9,] 0.00 0.0 0.0 0.0 0.0000000 0 0.1111111 0.0625 0.0 0
#> [10,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0625 0.5 1
#> [11,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000 0.0 0
#> [,11]
#> [1,] 10000
#> [2,] 10000
#> [3,] 0
#> [4,] 0
#> [5,] 0
#> [6,] 0
#> [7,] 0
#> [8,] 0
#> [9,] 0
#> [10,] 1
#> [11,] 0
#>
#> $A$`9`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> [1,] 0.03 0.0 0.0 0.0 0.0000000 0.0000000 0.0000000 250.0 0.0 1250.00
#> [2,] 0.15 0.0 0.0 0.0 0.0000000 0.0000000 0.0000000 250.0 0.0 1250.00
#> [3,] 0.00 0.1 0.0 0.0 0.0000000 0.0000000 0.0000000 0.0 0.0 0.00
#> [4,] 0.00 0.0 0.1 0.0 0.0000000 0.0000000 0.0000000 0.0 0.0 0.00
#> [5,] 0.00 0.0 0.0 0.1 0.0500000 0.0000000 0.0000000 0.0 0.0 0.00
#> [6,] 0.00 0.0 0.0 0.0 0.1818182 0.3333333 0.1818182 0.0 0.0 0.00
#> [7,] 0.00 0.0 0.0 0.0 0.2727273 0.3333333 0.2727273 0.2 0.0 0.00
#> [8,] 0.00 0.0 0.0 0.0 0.0000000 0.0000000 0.4545455 0.2 0.5 0.00
#> [9,] 0.00 0.0 0.0 0.0 0.0000000 0.0000000 0.0000000 0.4 0.5 0.50
#> [10,] 0.00 0.0 0.0 0.0 0.0000000 0.3333333 0.0000000 0.0 0.0 0.25
#> [11,] 0.00 0.0 0.0 0.0 0.0000000 0.0000000 0.0000000 0.0 0.0 0.25
#> [,11]
#> [1,] 0
#> [2,] 0
#> [3,] 0
#> [4,] 0
#> [5,] 0
#> [6,] 0
#> [7,] 0
#> [8,] 0
#> [9,] 0
#> [10,] 0
#> [11,] 0
#>
#> $A$`10`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> [1,] 0.03 0.0 0.0 0.0 0.0000000 0 0.0000000 0.000 714.2857143 1250
#> [2,] 0.15 0.0 0.0 0.0 0.0000000 0 0.0000000 0.000 714.2857143 1250
#> [3,] 0.00 0.1 0.0 0.0 0.0000000 0 0.0000000 0.000 0.0000000 0
#> [4,] 0.00 0.0 0.1 0.0 0.0000000 0 0.0000000 0.000 0.0000000 0
#> [5,] 0.00 0.0 0.0 0.1 0.0500000 0 0.0000000 0.000 0.0000000 0
#> [6,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.000 0.0000000 0
#> [7,] 0.00 0.0 0.0 0.0 0.5714286 1 0.5714286 0.125 0.0000000 0
#> [8,] 0.00 0.0 0.0 0.0 0.0000000 0 0.2857143 0.750 0.0000000 0
#> [9,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.125 0.7142857 0
#> [10,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.000 0.2857143 1
#> [11,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.000 0.0000000 0
#> [,11]
#> [1,] 2500
#> [2,] 2500
#> [3,] 0
#> [4,] 0
#> [5,] 0
#> [6,] 0
#> [7,] 0
#> [8,] 0
#> [9,] 0
#> [10,] 0
#> [11,] 1
#>
#> $A$`11`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> [1,] 0.03 0.0 0.0 0.0 0.0000000 0 0.0000000 625.00 833.3333333 0
#> [2,] 0.15 0.0 0.0 0.0 0.0000000 0 0.0000000 625.00 833.3333333 0
#> [3,] 0.00 0.1 0.0 0.0 0.0000000 0 0.0000000 0.00 0.0000000 0
#> [4,] 0.00 0.0 0.1 0.0 0.0000000 0 0.0000000 0.00 0.0000000 0
#> [5,] 0.00 0.0 0.0 0.1 0.0500000 0 0.0000000 0.00 0.0000000 0
#> [6,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.00 0.0000000 0
#> [7,] 0.00 0.0 0.0 0.0 0.6666667 0 0.6666667 0.25 0.0000000 0
#> [8,] 0.00 0.0 0.0 0.0 0.0000000 0 0.3333333 0.50 0.3333333 0
#> [9,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.25 0.6666667 0
#> [10,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.00 0.0000000 1
#> [11,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.00 0.0000000 0
#> [,11]
#> [1,] 7500
#> [2,] 7500
#> [3,] 0
#> [4,] 0
#> [5,] 0
#> [6,] 0
#> [7,] 0
#> [8,] 0
#> [9,] 0
#> [10,] 0
#> [11,] 1
#>
#> $A$`12`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0.03 0.0 0.0 0.0 0.00 0 0.00 0.0000000 4166.6666667 1250 5000
#> [2,] 0.15 0.0 0.0 0.0 0.00 0 0.00 0.0000000 4166.6666667 1250 5000
#> [3,] 0.00 0.1 0.0 0.0 0.00 0 0.00 0.0000000 0.0000000 0 0
#> [4,] 0.00 0.0 0.1 0.0 0.00 0 0.00 0.0000000 0.0000000 0 0
#> [5,] 0.00 0.0 0.0 0.1 0.05 0 0.00 0.0000000 0.0000000 0 0
#> [6,] 0.00 0.0 0.0 0.0 0.00 0 0.00 0.0000000 0.0000000 0 0
#> [7,] 0.00 0.0 0.0 0.0 0.75 0 0.75 0.1666667 0.0000000 0 0
#> [8,] 0.00 0.0 0.0 0.0 0.00 0 0.00 0.8333333 0.6666667 0 0
#> [9,] 0.00 0.0 0.0 0.0 0.00 0 0.00 0.0000000 0.3333333 1 0
#> [10,] 0.00 0.0 0.0 0.0 0.00 0 0.00 0.0000000 0.0000000 0 1
#> [11,] 0.00 0.0 0.0 0.0 0.00 0 0.00 0.0000000 0.0000000 0 0
#>
#> $A$`13`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0.03 0.0 0.0 0.0 0.00 0 0.00 1071.4285714 2500.0000000 2500 0
#> [2,] 0.15 0.0 0.0 0.0 0.00 0 0.00 1071.4285714 2500.0000000 2500 0
#> [3,] 0.00 0.1 0.0 0.0 0.00 0 0.00 0.0000000 0.0000000 0 0
#> [4,] 0.00 0.0 0.1 0.0 0.00 0 0.00 0.0000000 0.0000000 0 0
#> [5,] 0.00 0.0 0.0 0.1 0.05 0 0.00 0.0000000 0.0000000 0 0
#> [6,] 0.00 0.0 0.0 0.0 0.00 0 0.00 0.0000000 0.0000000 0 0
#> [7,] 0.00 0.0 0.0 0.0 0.50 0 0.50 0.0000000 0.3333333 0 0
#> [8,] 0.00 0.0 0.0 0.0 0.00 0 0.25 0.5714286 0.3333333 0 0
#> [9,] 0.00 0.0 0.0 0.0 0.00 0 0.00 0.2857143 0.3333333 0 0
#> [10,] 0.00 0.0 0.0 0.0 0.00 0 0.00 0.1428571 0.0000000 1 0
#> [11,] 0.00 0.0 0.0 0.0 0.00 0 0.00 0.0000000 0.0000000 0 0
#>
#> $A$`14`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> [1,] 0.03 0.0 0.0 0.0 0.0000000 0 0.0000000 416.6666667 0.0000000 0.0
#> [2,] 0.15 0.0 0.0 0.0 0.0000000 0 0.0000000 416.6666667 0.0000000 0.0
#> [3,] 0.00 0.1 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0.0
#> [4,] 0.00 0.0 0.1 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0.0
#> [5,] 0.00 0.0 0.0 0.1 0.0500000 0 0.0000000 0.0000000 0.0000000 0.0
#> [6,] 0.00 0.0 0.0 0.0 0.3333333 0 0.3333333 0.1666667 0.0000000 0.0
#> [7,] 0.00 0.0 0.0 0.0 0.3333333 0 0.3333333 0.1666667 0.3333333 0.0
#> [8,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.3333333 0.3333333 0.5
#> [9,] 0.00 0.0 0.0 0.0 0.0000000 0 0.3333333 0.3333333 0.3333333 0.0
#> [10,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0.0
#> [11,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0.5
#> [,11]
#> [1,] 0
#> [2,] 0
#> [3,] 0
#> [4,] 0
#> [5,] 0
#> [6,] 0
#> [7,] 0
#> [8,] 0
#> [9,] 0
#> [10,] 0
#> [11,] 0
#>
#> $A$`15`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0.03 0.0 0.0 0.0 0.00 0.0 0.00 0.00 625 0 0
#> [2,] 0.15 0.0 0.0 0.0 0.00 0.0 0.00 0.00 625 0 0
#> [3,] 0.00 0.1 0.0 0.0 0.00 0.0 0.00 0.00 0 0 0
#> [4,] 0.00 0.0 0.1 0.0 0.00 0.0 0.00 0.00 0 0 0
#> [5,] 0.00 0.0 0.0 0.1 0.05 0.0 0.00 0.00 0 0 0
#> [6,] 0.00 0.0 0.0 0.0 0.00 0.0 0.00 0.00 0 0 0
#> [7,] 0.00 0.0 0.0 0.0 0.25 0.5 0.25 0.00 0 0 0
#> [8,] 0.00 0.0 0.0 0.0 0.00 0.5 0.75 0.50 0 0 0
#> [9,] 0.00 0.0 0.0 0.0 0.00 0.0 0.00 0.25 1 0 0
#> [10,] 0.00 0.0 0.0 0.0 0.00 0.0 0.00 0.25 0 0 0
#> [11,] 0.00 0.0 0.0 0.0 0.00 0.0 0.00 0.00 0 0 1
#>
#>
#> $U
#> $U$`1`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0.03 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0 0.0000000 0 0
#> [2,] 0.15 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0 0.0000000 0 0
#> [3,] 0.00 0.1 0.0 0.0 0.0000000 0 0.0000000 0.0 0.0000000 0 0
#> [4,] 0.00 0.0 0.1 0.0 0.0000000 0 0.0000000 0.0 0.0000000 0 0
#> [5,] 0.00 0.0 0.0 0.1 0.0500000 0 0.0000000 0.0 0.0000000 0 0
#> [6,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0 0.0000000 0 0
#> [7,] 0.00 0.0 0.0 0.0 0.6363636 0 0.6363636 0.2 0.0000000 0 0
#> [8,] 0.00 0.0 0.0 0.0 0.0000000 0 0.2727273 0.6 0.6666667 1 0
#> [9,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.2 0.3333333 0 0
#> [10,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0 0.0000000 0 0
#> [11,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0 0.0000000 0 0
#>
#> $U$`2`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0.03 0.0 0.0 0.0 0.000 0 0.000 0.0000000 0 0 0
#> [2,] 0.15 0.0 0.0 0.0 0.000 0 0.000 0.0000000 0 0 0
#> [3,] 0.00 0.1 0.0 0.0 0.000 0 0.000 0.0000000 0 0 0
#> [4,] 0.00 0.0 0.1 0.0 0.000 0 0.000 0.0000000 0 0 0
#> [5,] 0.00 0.0 0.0 0.1 0.050 0 0.000 0.0000000 0 0 0
#> [6,] 0.00 0.0 0.0 0.0 0.125 0 0.125 0.0000000 0 0 0
#> [7,] 0.00 0.0 0.0 0.0 0.750 0 0.750 0.3333333 0 0 0
#> [8,] 0.00 0.0 0.0 0.0 0.000 0 0.000 0.4444444 0 0 0
#> [9,] 0.00 0.0 0.0 0.0 0.000 0 0.000 0.2222222 1 0 0
#> [10,] 0.00 0.0 0.0 0.0 0.000 0 0.000 0.0000000 0 0 0
#> [11,] 0.00 0.0 0.0 0.0 0.000 0 0.000 0.0000000 0 0 0
#>
#> $U$`3`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0.03 0.0 0.0 0.0 0.0000000 0 0.0000000 0 0.00 0 0
#> [2,] 0.15 0.0 0.0 0.0 0.0000000 0 0.0000000 0 0.00 0 0
#> [3,] 0.00 0.1 0.0 0.0 0.0000000 0 0.0000000 0 0.00 0 0
#> [4,] 0.00 0.0 0.1 0.0 0.0000000 0 0.0000000 0 0.00 0 0
#> [5,] 0.00 0.0 0.0 0.1 0.0500000 0 0.0000000 0 0.00 0 0
#> [6,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0 0.00 0 0
#> [7,] 0.00 0.0 0.0 0.0 0.6666667 0 0.6666667 0 0.00 0 0
#> [8,] 0.00 0.0 0.0 0.0 0.0000000 1 0.3333333 1 0.25 0 0
#> [9,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0 0.75 0 0
#> [10,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0 0.00 0 0
#> [11,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0 0.00 0 0
#>
#> $U$`4`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> [1,] 0.03 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0
#> [2,] 0.15 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0
#> [3,] 0.00 0.1 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0
#> [4,] 0.00 0.0 0.1 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0
#> [5,] 0.00 0.0 0.0 0.1 0.0500000 0 0.0000000 0.0000000 0.0000000 0
#> [6,] 0.00 0.0 0.0 0.0 0.1666667 0 0.1666667 0.2222222 0.0000000 0
#> [7,] 0.00 0.0 0.0 0.0 0.5000000 0 0.5000000 0.4444444 0.3333333 0
#> [8,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.3333333 0.3333333 0
#> [9,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.3333333 0
#> [10,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0
#> [11,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0
#> [,11]
#> [1,] 0
#> [2,] 0
#> [3,] 0
#> [4,] 0
#> [5,] 0
#> [6,] 0
#> [7,] 0
#> [8,] 0
#> [9,] 0
#> [10,] 0
#> [11,] 0
#>
#> $U$`5`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0.03 0.0 0.0 0.0 0.0000000 0.0000000 0.0000000 0.0 0 0 0
#> [2,] 0.15 0.0 0.0 0.0 0.0000000 0.0000000 0.0000000 0.0 0 0 0
#> [3,] 0.00 0.1 0.0 0.0 0.0000000 0.0000000 0.0000000 0.0 0 0 0
#> [4,] 0.00 0.0 0.1 0.0 0.0000000 0.0000000 0.0000000 0.0 0 0 0
#> [5,] 0.00 0.0 0.0 0.1 0.0500000 0.0000000 0.0000000 0.0 0 0 0
#> [6,] 0.00 0.0 0.0 0.0 0.0000000 0.0000000 0.0000000 0.0 0 0 0
#> [7,] 0.00 0.0 0.0 0.0 0.4444444 0.3333333 0.4444444 0.0 0 0 0
#> [8,] 0.00 0.0 0.0 0.0 0.0000000 0.6666667 0.4444444 0.6 0 0 0
#> [9,] 0.00 0.0 0.0 0.0 0.0000000 0.0000000 0.0000000 0.0 0 0 0
#> [10,] 0.00 0.0 0.0 0.0 0.0000000 0.0000000 0.0000000 0.0 1 0 0
#> [11,] 0.00 0.0 0.0 0.0 0.0000000 0.0000000 0.0000000 0.0 0 0 0
#>
#> $U$`6`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0.03 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.00 0.00 0
#> [2,] 0.15 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.00 0.00 0
#> [3,] 0.00 0.1 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.00 0.00 0
#> [4,] 0.00 0.0 0.1 0.0 0.0000000 0 0.0000000 0.0000000 0.00 0.00 0
#> [5,] 0.00 0.0 0.0 0.1 0.0500000 0 0.0000000 0.0000000 0.00 0.00 0
#> [6,] 0.00 0.0 0.0 0.0 0.1111111 0 0.1111111 0.0000000 0.00 0.00 0
#> [7,] 0.00 0.0 0.0 0.0 0.6666667 0 0.6666667 0.2666667 0.00 0.00 0
#> [8,] 0.00 0.0 0.0 0.0 0.0000000 0 0.1111111 0.6000000 0.50 0.00 0
#> [9,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.1333333 0.25 0.25 0
#> [10,] 0.00 0.0 0.0 0.0 0.0000000 0 0.1111111 0.0000000 0.25 0.50 0
#> [11,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.00 0.25 0
#>
#> $U$`7`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> [1,] 0.03 0.0 0.0 0.0 0.00000000 0 0.00000000 0.00000000 0.00 0.00
#> [2,] 0.15 0.0 0.0 0.0 0.00000000 0 0.00000000 0.00000000 0.00 0.00
#> [3,] 0.00 0.1 0.0 0.0 0.00000000 0 0.00000000 0.00000000 0.00 0.00
#> [4,] 0.00 0.0 0.1 0.0 0.00000000 0 0.00000000 0.00000000 0.00 0.00
#> [5,] 0.00 0.0 0.0 0.1 0.05000000 0 0.00000000 0.00000000 0.00 0.00
#> [6,] 0.00 0.0 0.0 0.0 0.09090909 0 0.09090909 0.08333333 0.00 0.00
#> [7,] 0.00 0.0 0.0 0.0 0.45454545 0 0.45454545 0.25000000 0.25 0.00
#> [8,] 0.00 0.0 0.0 0.0 0.00000000 1 0.36363636 0.58333333 0.50 0.50
#> [9,] 0.00 0.0 0.0 0.0 0.00000000 0 0.00000000 0.00000000 0.25 0.25
#> [10,] 0.00 0.0 0.0 0.0 0.00000000 0 0.00000000 0.00000000 0.00 0.25
#> [11,] 0.00 0.0 0.0 0.0 0.00000000 0 0.00000000 0.00000000 0.00 0.00
#> [,11]
#> [1,] 0
#> [2,] 0
#> [3,] 0
#> [4,] 0
#> [5,] 0
#> [6,] 0
#> [7,] 0
#> [8,] 0
#> [9,] 0
#> [10,] 0
#> [11,] 1
#>
#> $U$`8`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0.03 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000 0.0 0 0
#> [2,] 0.15 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000 0.0 0 0
#> [3,] 0.00 0.1 0.0 0.0 0.0000000 0 0.0000000 0.0000 0.0 0 0
#> [4,] 0.00 0.0 0.1 0.0 0.0000000 0 0.0000000 0.0000 0.0 0 0
#> [5,] 0.00 0.0 0.0 0.1 0.0500000 0 0.0000000 0.0000 0.0 0 0
#> [6,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.1875 0.0 0 0
#> [7,] 0.00 0.0 0.0 0.0 0.3333333 1 0.3333333 0.3125 0.0 0 0
#> [8,] 0.00 0.0 0.0 0.0 0.0000000 0 0.3333333 0.3750 0.5 0 0
#> [9,] 0.00 0.0 0.0 0.0 0.0000000 0 0.1111111 0.0625 0.0 0 0
#> [10,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0625 0.5 1 1
#> [11,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000 0.0 0 0
#>
#> $U$`9`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0.03 0.0 0.0 0.0 0.0000000 0.0000000 0.0000000 0.0 0.0 0.00 0
#> [2,] 0.15 0.0 0.0 0.0 0.0000000 0.0000000 0.0000000 0.0 0.0 0.00 0
#> [3,] 0.00 0.1 0.0 0.0 0.0000000 0.0000000 0.0000000 0.0 0.0 0.00 0
#> [4,] 0.00 0.0 0.1 0.0 0.0000000 0.0000000 0.0000000 0.0 0.0 0.00 0
#> [5,] 0.00 0.0 0.0 0.1 0.0500000 0.0000000 0.0000000 0.0 0.0 0.00 0
#> [6,] 0.00 0.0 0.0 0.0 0.1818182 0.3333333 0.1818182 0.0 0.0 0.00 0
#> [7,] 0.00 0.0 0.0 0.0 0.2727273 0.3333333 0.2727273 0.2 0.0 0.00 0
#> [8,] 0.00 0.0 0.0 0.0 0.0000000 0.0000000 0.4545455 0.2 0.5 0.00 0
#> [9,] 0.00 0.0 0.0 0.0 0.0000000 0.0000000 0.0000000 0.4 0.5 0.50 0
#> [10,] 0.00 0.0 0.0 0.0 0.0000000 0.3333333 0.0000000 0.0 0.0 0.25 0
#> [11,] 0.00 0.0 0.0 0.0 0.0000000 0.0000000 0.0000000 0.0 0.0 0.25 0
#>
#> $U$`10`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0.03 0.0 0.0 0.0 0.0000000 0 0.0000000 0.000 0.0000000 0 0
#> [2,] 0.15 0.0 0.0 0.0 0.0000000 0 0.0000000 0.000 0.0000000 0 0
#> [3,] 0.00 0.1 0.0 0.0 0.0000000 0 0.0000000 0.000 0.0000000 0 0
#> [4,] 0.00 0.0 0.1 0.0 0.0000000 0 0.0000000 0.000 0.0000000 0 0
#> [5,] 0.00 0.0 0.0 0.1 0.0500000 0 0.0000000 0.000 0.0000000 0 0
#> [6,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.000 0.0000000 0 0
#> [7,] 0.00 0.0 0.0 0.0 0.5714286 1 0.5714286 0.125 0.0000000 0 0
#> [8,] 0.00 0.0 0.0 0.0 0.0000000 0 0.2857143 0.750 0.0000000 0 0
#> [9,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.125 0.7142857 0 0
#> [10,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.000 0.2857143 1 0
#> [11,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.000 0.0000000 0 1
#>
#> $U$`11`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0.03 0.0 0.0 0.0 0.0000000 0 0.0000000 0.00 0.0000000 0 0
#> [2,] 0.15 0.0 0.0 0.0 0.0000000 0 0.0000000 0.00 0.0000000 0 0
#> [3,] 0.00 0.1 0.0 0.0 0.0000000 0 0.0000000 0.00 0.0000000 0 0
#> [4,] 0.00 0.0 0.1 0.0 0.0000000 0 0.0000000 0.00 0.0000000 0 0
#> [5,] 0.00 0.0 0.0 0.1 0.0500000 0 0.0000000 0.00 0.0000000 0 0
#> [6,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.00 0.0000000 0 0
#> [7,] 0.00 0.0 0.0 0.0 0.6666667 0 0.6666667 0.25 0.0000000 0 0
#> [8,] 0.00 0.0 0.0 0.0 0.0000000 0 0.3333333 0.50 0.3333333 0 0
#> [9,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.25 0.6666667 0 0
#> [10,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.00 0.0000000 1 0
#> [11,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.00 0.0000000 0 1
#>
#> $U$`12`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0.03 0.0 0.0 0.0 0.00 0 0.00 0.0000000 0.0000000 0 0
#> [2,] 0.15 0.0 0.0 0.0 0.00 0 0.00 0.0000000 0.0000000 0 0
#> [3,] 0.00 0.1 0.0 0.0 0.00 0 0.00 0.0000000 0.0000000 0 0
#> [4,] 0.00 0.0 0.1 0.0 0.00 0 0.00 0.0000000 0.0000000 0 0
#> [5,] 0.00 0.0 0.0 0.1 0.05 0 0.00 0.0000000 0.0000000 0 0
#> [6,] 0.00 0.0 0.0 0.0 0.00 0 0.00 0.0000000 0.0000000 0 0
#> [7,] 0.00 0.0 0.0 0.0 0.75 0 0.75 0.1666667 0.0000000 0 0
#> [8,] 0.00 0.0 0.0 0.0 0.00 0 0.00 0.8333333 0.6666667 0 0
#> [9,] 0.00 0.0 0.0 0.0 0.00 0 0.00 0.0000000 0.3333333 1 0
#> [10,] 0.00 0.0 0.0 0.0 0.00 0 0.00 0.0000000 0.0000000 0 1
#> [11,] 0.00 0.0 0.0 0.0 0.00 0 0.00 0.0000000 0.0000000 0 0
#>
#> $U$`13`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0.03 0.0 0.0 0.0 0.00 0 0.00 0.0000000 0.0000000 0 0
#> [2,] 0.15 0.0 0.0 0.0 0.00 0 0.00 0.0000000 0.0000000 0 0
#> [3,] 0.00 0.1 0.0 0.0 0.00 0 0.00 0.0000000 0.0000000 0 0
#> [4,] 0.00 0.0 0.1 0.0 0.00 0 0.00 0.0000000 0.0000000 0 0
#> [5,] 0.00 0.0 0.0 0.1 0.05 0 0.00 0.0000000 0.0000000 0 0
#> [6,] 0.00 0.0 0.0 0.0 0.00 0 0.00 0.0000000 0.0000000 0 0
#> [7,] 0.00 0.0 0.0 0.0 0.50 0 0.50 0.0000000 0.3333333 0 0
#> [8,] 0.00 0.0 0.0 0.0 0.00 0 0.25 0.5714286 0.3333333 0 0
#> [9,] 0.00 0.0 0.0 0.0 0.00 0 0.00 0.2857143 0.3333333 0 0
#> [10,] 0.00 0.0 0.0 0.0 0.00 0 0.00 0.1428571 0.0000000 1 0
#> [11,] 0.00 0.0 0.0 0.0 0.00 0 0.00 0.0000000 0.0000000 0 0
#>
#> $U$`14`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> [1,] 0.03 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0.0
#> [2,] 0.15 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0.0
#> [3,] 0.00 0.1 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0.0
#> [4,] 0.00 0.0 0.1 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0.0
#> [5,] 0.00 0.0 0.0 0.1 0.0500000 0 0.0000000 0.0000000 0.0000000 0.0
#> [6,] 0.00 0.0 0.0 0.0 0.3333333 0 0.3333333 0.1666667 0.0000000 0.0
#> [7,] 0.00 0.0 0.0 0.0 0.3333333 0 0.3333333 0.1666667 0.3333333 0.0
#> [8,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.3333333 0.3333333 0.5
#> [9,] 0.00 0.0 0.0 0.0 0.0000000 0 0.3333333 0.3333333 0.3333333 0.0
#> [10,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0.0
#> [11,] 0.00 0.0 0.0 0.0 0.0000000 0 0.0000000 0.0000000 0.0000000 0.5
#> [,11]
#> [1,] 0
#> [2,] 0
#> [3,] 0
#> [4,] 0
#> [5,] 0
#> [6,] 0
#> [7,] 0
#> [8,] 0
#> [9,] 0
#> [10,] 0
#> [11,] 0
#>
#> $U$`15`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0.03 0.0 0.0 0.0 0.00 0.0 0.00 0.00 0 0 0
#> [2,] 0.15 0.0 0.0 0.0 0.00 0.0 0.00 0.00 0 0 0
#> [3,] 0.00 0.1 0.0 0.0 0.00 0.0 0.00 0.00 0 0 0
#> [4,] 0.00 0.0 0.1 0.0 0.00 0.0 0.00 0.00 0 0 0
#> [5,] 0.00 0.0 0.0 0.1 0.05 0.0 0.00 0.00 0 0 0
#> [6,] 0.00 0.0 0.0 0.0 0.00 0.0 0.00 0.00 0 0 0
#> [7,] 0.00 0.0 0.0 0.0 0.25 0.5 0.25 0.00 0 0 0
#> [8,] 0.00 0.0 0.0 0.0 0.00 0.5 0.75 0.50 0 0 0
#> [9,] 0.00 0.0 0.0 0.0 0.00 0.0 0.00 0.25 1 0 0
#> [10,] 0.00 0.0 0.0 0.0 0.00 0.0 0.00 0.25 0 0 0
#> [11,] 0.00 0.0 0.0 0.0 0.00 0.0 0.00 0.00 0 0 1
#>
#>
#> $F
#> $F$`1`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0 0 0 0 0 0 0 500 1666.667 0 0
#> [2,] 0 0 0 0 0 0 0 500 1666.667 0 0
#> [3,] 0 0 0 0 0 0 0 0 0.000 0 0
#> [4,] 0 0 0 0 0 0 0 0 0.000 0 0
#> [5,] 0 0 0 0 0 0 0 0 0.000 0 0
#> [6,] 0 0 0 0 0 0 0 0 0.000 0 0
#> [7,] 0 0 0 0 0 0 0 0 0.000 0 0
#> [8,] 0 0 0 0 0 0 0 0 0.000 0 0
#> [9,] 0 0 0 0 0 0 0 0 0.000 0 0
#> [10,] 0 0 0 0 0 0 0 0 0.000 0 0
#> [11,] 0 0 0 0 0 0 0 0 0.000 0 0
#>
#> $F$`2`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0 0 0 0 0 0 312.5 1111.111 1250 0 0
#> [2,] 0 0 0 0 0 0 312.5 1111.111 1250 0 0
#> [3,] 0 0 0 0 0 0 0.0 0.000 0 0 0
#> [4,] 0 0 0 0 0 0 0.0 0.000 0 0 0
#> [5,] 0 0 0 0 0 0 0.0 0.000 0 0 0
#> [6,] 0 0 0 0 0 0 0.0 0.000 0 0 0
#> [7,] 0 0 0 0 0 0 0.0 0.000 0 0 0
#> [8,] 0 0 0 0 0 0 0.0 0.000 0 0 0
#> [9,] 0 0 0 0 0 0 0.0 0.000 0 0 0
#> [10,] 0 0 0 0 0 0 0.0 0.000 0 0 0
#> [11,] 0 0 0 0 0 0 0.0 0.000 0 0 0
#>
#> $F$`3`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0 0 0 0 0 0 0 0 0 0 0
#> [2,] 0 0 0 0 0 0 0 0 0 0 0
#> [3,] 0 0 0 0 0 0 0 0 0 0 0
#> [4,] 0 0 0 0 0 0 0 0 0 0 0
#> [5,] 0 0 0 0 0 0 0 0 0 0 0
#> [6,] 0 0 0 0 0 0 0 0 0 0 0
#> [7,] 0 0 0 0 0 0 0 0 0 0 0
#> [8,] 0 0 0 0 0 0 0 0 0 0 0
#> [9,] 0 0 0 0 0 0 0 0 0 0 0
#> [10,] 0 0 0 0 0 0 0 0 0 0 0
#> [11,] 0 0 0 0 0 0 0 0 0 0 0
#>
#> $F$`4`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0 0 0 0 0 0 0 0 0 0 0
#> [2,] 0 0 0 0 0 0 0 0 0 0 0
#> [3,] 0 0 0 0 0 0 0 0 0 0 0
#> [4,] 0 0 0 0 0 0 0 0 0 0 0
#> [5,] 0 0 0 0 0 0 0 0 0 0 0
#> [6,] 0 0 0 0 0 0 0 0 0 0 0
#> [7,] 0 0 0 0 0 0 0 0 0 0 0
#> [8,] 0 0 0 0 0 0 0 0 0 0 0
#> [9,] 0 0 0 0 0 0 0 0 0 0 0
#> [10,] 0 0 0 0 0 0 0 0 0 0 0
#> [11,] 0 0 0 0 0 0 0 0 0 0 0
#>
#> $F$`5`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0 0 0 0 0 0 0 500 5000 0 0
#> [2,] 0 0 0 0 0 0 0 500 5000 0 0
#> [3,] 0 0 0 0 0 0 0 0 0 0 0
#> [4,] 0 0 0 0 0 0 0 0 0 0 0
#> [5,] 0 0 0 0 0 0 0 0 0 0 0
#> [6,] 0 0 0 0 0 0 0 0 0 0 0
#> [7,] 0 0 0 0 0 0 0 0 0 0 0
#> [8,] 0 0 0 0 0 0 0 0 0 0 0
#> [9,] 0 0 0 0 0 0 0 0 0 0 0
#> [10,] 0 0 0 0 0 0 0 0 0 0 0
#> [11,] 0 0 0 0 0 0 0 0 0 0 0
#>
#> $F$`6`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0 0 0 0 0 0 0 166.6667 625 1875 0
#> [2,] 0 0 0 0 0 0 0 166.6667 625 1875 0
#> [3,] 0 0 0 0 0 0 0 0.0000 0 0 0
#> [4,] 0 0 0 0 0 0 0 0.0000 0 0 0
#> [5,] 0 0 0 0 0 0 0 0.0000 0 0 0
#> [6,] 0 0 0 0 0 0 0 0.0000 0 0 0
#> [7,] 0 0 0 0 0 0 0 0.0000 0 0 0
#> [8,] 0 0 0 0 0 0 0 0.0000 0 0 0
#> [9,] 0 0 0 0 0 0 0 0.0000 0 0 0
#> [10,] 0 0 0 0 0 0 0 0.0000 0 0 0
#> [11,] 0 0 0 0 0 0 0 0.0000 0 0 0
#>
#> $F$`7`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0 0 0 0 0 0 0 1666.667 4375 5000 17500
#> [2,] 0 0 0 0 0 0 0 1666.667 4375 5000 17500
#> [3,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [4,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [5,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [6,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [7,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [8,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [9,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [10,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [11,] 0 0 0 0 0 0 0 0.000 0 0 0
#>
#> $F$`8`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0 0 0 0 0 0 277.7778 781.25 6250 5000 10000
#> [2,] 0 0 0 0 0 0 277.7778 781.25 6250 5000 10000
#> [3,] 0 0 0 0 0 0 0.0000 0.00 0 0 0
#> [4,] 0 0 0 0 0 0 0.0000 0.00 0 0 0
#> [5,] 0 0 0 0 0 0 0.0000 0.00 0 0 0
#> [6,] 0 0 0 0 0 0 0.0000 0.00 0 0 0
#> [7,] 0 0 0 0 0 0 0.0000 0.00 0 0 0
#> [8,] 0 0 0 0 0 0 0.0000 0.00 0 0 0
#> [9,] 0 0 0 0 0 0 0.0000 0.00 0 0 0
#> [10,] 0 0 0 0 0 0 0.0000 0.00 0 0 0
#> [11,] 0 0 0 0 0 0 0.0000 0.00 0 0 0
#>
#> $F$`9`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0 0 0 0 0 0 0 250 0 1250 0
#> [2,] 0 0 0 0 0 0 0 250 0 1250 0
#> [3,] 0 0 0 0 0 0 0 0 0 0 0
#> [4,] 0 0 0 0 0 0 0 0 0 0 0
#> [5,] 0 0 0 0 0 0 0 0 0 0 0
#> [6,] 0 0 0 0 0 0 0 0 0 0 0
#> [7,] 0 0 0 0 0 0 0 0 0 0 0
#> [8,] 0 0 0 0 0 0 0 0 0 0 0
#> [9,] 0 0 0 0 0 0 0 0 0 0 0
#> [10,] 0 0 0 0 0 0 0 0 0 0 0
#> [11,] 0 0 0 0 0 0 0 0 0 0 0
#>
#> $F$`10`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0 0 0 0 0 0 0 0 714.2857 1250 2500
#> [2,] 0 0 0 0 0 0 0 0 714.2857 1250 2500
#> [3,] 0 0 0 0 0 0 0 0 0.0000 0 0
#> [4,] 0 0 0 0 0 0 0 0 0.0000 0 0
#> [5,] 0 0 0 0 0 0 0 0 0.0000 0 0
#> [6,] 0 0 0 0 0 0 0 0 0.0000 0 0
#> [7,] 0 0 0 0 0 0 0 0 0.0000 0 0
#> [8,] 0 0 0 0 0 0 0 0 0.0000 0 0
#> [9,] 0 0 0 0 0 0 0 0 0.0000 0 0
#> [10,] 0 0 0 0 0 0 0 0 0.0000 0 0
#> [11,] 0 0 0 0 0 0 0 0 0.0000 0 0
#>
#> $F$`11`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0 0 0 0 0 0 0 625 833.3333 0 7500
#> [2,] 0 0 0 0 0 0 0 625 833.3333 0 7500
#> [3,] 0 0 0 0 0 0 0 0 0.0000 0 0
#> [4,] 0 0 0 0 0 0 0 0 0.0000 0 0
#> [5,] 0 0 0 0 0 0 0 0 0.0000 0 0
#> [6,] 0 0 0 0 0 0 0 0 0.0000 0 0
#> [7,] 0 0 0 0 0 0 0 0 0.0000 0 0
#> [8,] 0 0 0 0 0 0 0 0 0.0000 0 0
#> [9,] 0 0 0 0 0 0 0 0 0.0000 0 0
#> [10,] 0 0 0 0 0 0 0 0 0.0000 0 0
#> [11,] 0 0 0 0 0 0 0 0 0.0000 0 0
#>
#> $F$`12`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0 0 0 0 0 0 0 0 4166.667 1250 5000
#> [2,] 0 0 0 0 0 0 0 0 4166.667 1250 5000
#> [3,] 0 0 0 0 0 0 0 0 0.000 0 0
#> [4,] 0 0 0 0 0 0 0 0 0.000 0 0
#> [5,] 0 0 0 0 0 0 0 0 0.000 0 0
#> [6,] 0 0 0 0 0 0 0 0 0.000 0 0
#> [7,] 0 0 0 0 0 0 0 0 0.000 0 0
#> [8,] 0 0 0 0 0 0 0 0 0.000 0 0
#> [9,] 0 0 0 0 0 0 0 0 0.000 0 0
#> [10,] 0 0 0 0 0 0 0 0 0.000 0 0
#> [11,] 0 0 0 0 0 0 0 0 0.000 0 0
#>
#> $F$`13`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0 0 0 0 0 0 0 1071.429 2500 2500 0
#> [2,] 0 0 0 0 0 0 0 1071.429 2500 2500 0
#> [3,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [4,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [5,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [6,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [7,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [8,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [9,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [10,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [11,] 0 0 0 0 0 0 0 0.000 0 0 0
#>
#> $F$`14`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0 0 0 0 0 0 0 416.6667 0 0 0
#> [2,] 0 0 0 0 0 0 0 416.6667 0 0 0
#> [3,] 0 0 0 0 0 0 0 0.0000 0 0 0
#> [4,] 0 0 0 0 0 0 0 0.0000 0 0 0
#> [5,] 0 0 0 0 0 0 0 0.0000 0 0 0
#> [6,] 0 0 0 0 0 0 0 0.0000 0 0 0
#> [7,] 0 0 0 0 0 0 0 0.0000 0 0 0
#> [8,] 0 0 0 0 0 0 0 0.0000 0 0 0
#> [9,] 0 0 0 0 0 0 0 0.0000 0 0 0
#> [10,] 0 0 0 0 0 0 0 0.0000 0 0 0
#> [11,] 0 0 0 0 0 0 0 0.0000 0 0 0
#>
#> $F$`15`
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0 0 0 0 0 0 0 0 625 0 0
#> [2,] 0 0 0 0 0 0 0 0 625 0 0
#> [3,] 0 0 0 0 0 0 0 0 0 0 0
#> [4,] 0 0 0 0 0 0 0 0 0 0 0
#> [5,] 0 0 0 0 0 0 0 0 0 0 0
#> [6,] 0 0 0 0 0 0 0 0 0 0 0
#> [7,] 0 0 0 0 0 0 0 0 0 0 0
#> [8,] 0 0 0 0 0 0 0 0 0 0 0
#> [9,] 0 0 0 0 0 0 0 0 0 0 0
#> [10,] 0 0 0 0 0 0 0 0 0 0 0
#> [11,] 0 0 0 0 0 0 0 0 0 0 0
#>
#>
#> $hstages
#> [1] NA
#>
#> $agestages
#> [1] NA
#>
#> $ahstages
#> stage_id stage original_size bin_size_ctr bin_size_min bin_size_max
#> 1 1 SD 0.0 0.0 0.0 0.0
#> 2 2 P1 0.0 0.0 0.0 0.0
#> 3 3 P2 0.0 0.0 0.0 0.0
#> 4 4 P3 0.0 0.0 0.0 0.0
#> 5 5 SL 0.0 0.0 0.0 0.0
#> 6 6 D 0.0 0.0 -0.5 0.5
#> 7 7 XSm 1.0 1.0 0.5 1.5
#> 8 8 Sm 3.0 3.0 1.5 4.5
#> 9 9 Md 6.0 6.0 4.5 7.5
#> 10 10 Lg 11.0 11.0 7.5 14.5
#> 11 11 XLg 19.5 19.5 14.5 24.5
#> repstatus obsstatus propstatus immstatus matstatus entrystage indataset
#> 1 0 0 1 0 0 1 0
#> 2 0 0 0 1 0 1 0
#> 3 0 0 0 1 0 0 0
#> 4 0 0 0 1 0 0 0
#> 5 0 0 0 1 0 0 0
#> 6 0 0 0 0 1 0 1
#> 7 1 1 0 0 1 0 1
#> 8 1 1 0 0 1 0 1
#> 9 1 1 0 0 1 0 1
#> 10 1 1 0 0 1 0 1
#> 11 1 1 0 0 1 0 1
#> bin_size_width bin_raw_halfwidth alive min_age max_age
#> 1 0 0.0 1 NA NA
#> 2 0 0.0 1 NA NA
#> 3 0 0.0 1 NA NA
#> 4 0 0.0 1 NA NA
#> 5 0 0.0 1 NA NA
#> 6 1 0.5 1 NA NA
#> 7 1 0.5 1 NA NA
#> 8 3 1.5 1 NA NA
#> 9 3 1.5 1 NA NA
#> 10 7 3.5 1 NA NA
#> 11 10 5.0 1 NA NA
#> comments stageno
#> 1 Dormant seed 1
#> 2 1st yr protocorm 2
#> 3 2nd yr protocorm 3
#> 4 3rd yr protocorm 4
#> 5 Seedling 5
#> 6 Dormant adult 6
#> 7 Extra small adult (1 shoot) 7
#> 8 Small adult (2-4 shoots) 8
#> 9 Medium adult (5-7 shoots) 9
#> 10 Large adult (8-14 shoots) 10
#> 11 Extra large adult (>14 shoots) 11
#>
#> $labels
#> pop patch year2
#> 1 1 A 2004
#> 2 1 A 2005
#> 3 1 A 2006
#> 4 1 A 2007
#> 5 1 A 2008
#> 6 1 B 2004
#> 7 1 B 2005
#> 8 1 B 2006
#> 9 1 B 2007
#> 10 1 B 2008
#> 11 1 C 2004
#> 12 1 C 2005
#> 13 1 C 2006
#> 14 1 C 2007
#> 15 1 C 2008
#>
#> $matrixqc
#> [1] 255 70 15
#>
#> $dataqc
#> [1] 74 320
#>
#> attr(,"class")
#> [1] "lefkoMat"
The output from this analysis is a lefkoMat object, which is a list object with the following elements:
A: a list of full population projection matrices, in order of population, patch, and year
U: a list of matrices showing only survival-transition elements, in the same order as A
F: a list of matrices showing only fecundity elements, in the same order as A
hstages: a data frame showing the order of paired stages (given if matrices are historical, otherwise NA)
agestages: this is a data frame showing the order of age-stages (if an age-by-stage MPM has been created, otherwise NA)
ahstages: this is the stageframe used in analysis, with stages reordered and edited as they occur in the matrix
labels: a table showing the order of matrices, according to population, patch, and year
matrixqc: a short vector used in summary statements to describe the overall quality of each matrix
dataqc: a short vector used in summary statements to describe key sampling aspects of the dataset (in raw MPMs)
modelqc: a short vector used in summary statements to describe the vital rate models (in function-based MPMs)
Calling particular values and elements within lefkoMat objects is not complicated, once you know the structure. The figure below illustrates how to call a particular element from one of the A matrices, for example.
Figure 3L.7. Organization of a lefkoMat object, and how to call a specific element.
Objects of class lefkoMat have their own summary statements, which we can use to understand more about them.
summary(cypmatrix2rp)
#>
#> This ahistorical lefkoMat object contains 15 matrices.
#>
#> Each matrix is a square matrix with 11 rows and columns, and a total of 121 elements.
#> A total of 255 survival transitions were estimated, with 17 per matrix.
#> A total of 70 fecundity transitions were estimated, with 4.667 per matrix.
#>
#> The dataset contains a total of 74 unique individuals and 320 unique transitions.
#>
#> Survival probability sum check (each matrix represented by column in order):
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12]
#> Min. 0.000 0.000 0.000 0.000 0.000 0.000 0.100 0.100 0.000 0.100 0.000 0.000
#> 1st Qu. 0.100 0.050 0.100 0.050 0.100 0.100 0.140 0.140 0.100 0.140 0.100 0.100
#> Median 0.180 0.100 0.180 0.100 0.180 0.180 0.909 0.778 0.505 0.857 0.717 0.750
#> Mean 0.461 0.389 0.472 0.351 0.406 0.483 0.627 0.604 0.518 0.633 0.563 0.548
#> 3rd Qu. 0.955 0.900 1.000 0.692 0.744 1.000 1.000 1.000 0.955 1.000 1.000 1.000
#> Max. 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
#> [,13] [,14] [,15]
#> Min. 0.000 0.000 0.000
#> 1st Qu. 0.100 0.100 0.100
#> Median 0.180 0.180 0.300
#> Mean 0.435 0.472 0.525
#> 3rd Qu. 0.875 1.000 1.000
#> Max. 1.000 1.000 1.000
#> NULL
We start off learning that 15 matrices were estimated, and we learn the dimensionality of those matrices. Of note here is the output telling us how many elements were actually estimated, both overall and per matrix, and the number of individuals and transitions the matrices are based on. It is typical for population ecologists to consider the total number of transitions in a dataset as a measure of the statistical power of a matrix, but the number of individuals used is just as important because each transition that an individual experiences is dependent on the other transitions that it also experiences. Indeed, this is the fundamental point that led to the development of historical matrices and of this package - the assumption that the status of an individual in the next time is dependent only on its current state is too simplistic, and may lead to both overparameterization and pseudoreplication (if vital rate models are used). The final bit of the summary shows us the range of survival probabilities of stages in the matrices, where the survival probabilities are calculated as column sums of each U matrix. Since there are 15 matrices, there are 15 summaries. It is important to check to see that no stage survives outside the realm of possibility (i.e. no probability should be greater than 1.0 or lower than 0.0). Unusual stage survival probabilities will result in a warning as a part of the summary() output.
The input for the rlefko2() function includes patch = "all" and year = "all", but can be set to focus on any set of patches/subpopulations or years included within the data. Package lefko3 includes a great deal of flexibility here, and can estimate many matrices covering all of the populations, patches, and years occurring in a specific dataset. For example, if we had wished to skip the patch divisions within the population and instead estimate only annual matrices at the population level, then we could have eliminated the patch option altogether from the input, as below.
cypmatrix2r <- rlefko2(data = cypraw_v1, stageframe = cypframe_raw,
year = "all", stages = c("stage3", "stage2"),
size = c("size3added", "size2added"), supplement = cypsupp2_raw,
yearcol = "year2", patchcol = "patchid", indivcol = "individ")
summary(cypmatrix2r)
#>
#> This ahistorical lefkoMat object contains 5 matrices.
#>
#> Each matrix is a square matrix with 11 rows and columns, and a total of 121 elements.
#> A total of 115 survival transitions were estimated, with 23 per matrix.
#> A total of 40 fecundity transitions were estimated, with 8 per matrix.
#>
#> The dataset contains a total of 74 unique individuals and 320 unique transitions.
#>
#> Survival probability sum check (each matrix represented by column in order):
#> [,1] [,2] [,3] [,4] [,5]
#> Min. 0.000 0.100 0.100 0.000 0.100
#> 1st Qu. 0.100 0.140 0.140 0.100 0.140
#> Median 0.746 0.870 0.864 0.600 0.882
#> Mean 0.562 0.642 0.627 0.532 0.615
#> 3rd Qu. 1.000 1.000 1.000 0.960 1.000
#> Max. 1.000 1.000 1.000 1.000 1.000
#> NULL
Notice what happened here. The first call to rlefko2() yielded 15 matrices, because there are 3 patches in our dataset, and there are a total of 6 years of data, yielding 5 transitions between years (also refered to as time steps or periods). So, there are \(3 \times 5 = 15\) matrices. But in the second call, we no longer recognize patches and so have only estimated one set of 5 matrices covering the whole population. We can also focus in on specific patches and specific sets of years, setting the options appropriately.
Now let’s estimate a raw, historical MPM, using the rlefko3() function.
cypmatrix3rp <- rlefko3(data = cypraw_v1, stageframe = cypframe_raw,
year = "all", patch = "all", stages = c("stage3", "stage2", "stage1"),
size = c("size3added", "size2added", "size1added"), supplement = cypsupp3_raw,
yearcol = "year2", patchcol = "patchid", indivcol = "individ")
summary(cypmatrix3rp)
#>
#> This historical lefkoMat object contains 12 matrices.
#>
#> Each matrix is a square matrix with 121 rows and columns, and a total of 14641 elements.
#> A total of 386 survival transitions were estimated, with 32.167 per matrix.
#> A total of 68 fecundity transitions were estimated, with 5.667 per matrix.
#>
#> The dataset contains a total of 74 unique individuals and 320 unique transitions.
#>
#> Survival probability sum check (each matrix represented by column in order):
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> Min. 0.0000 0.0000 0.0000 0.0000 0.000 0.00 0.000 0.000 0.0000 0.000 0.0000
#> 1st Qu. 0.0000 0.0000 0.0000 0.0000 0.000 0.00 0.000 0.000 0.0000 0.000 0.0000
#> Median 0.0000 0.0000 0.0000 0.0000 0.000 0.00 0.000 0.000 0.0000 0.000 0.0000
#> Mean 0.0862 0.0706 0.0665 0.0754 0.124 0.13 0.123 0.135 0.0968 0.072 0.0968
#> 3rd Qu. 0.0000 0.0000 0.0000 0.0000 0.000 0.00 0.000 0.000 0.0000 0.000 0.0000
#> Max. 1.0000 1.0000 1.0000 1.0000 1.000 1.00 1.000 1.000 1.0500 1.000 1.0000
#> [,12]
#> Min. 0.000
#> 1st Qu. 0.000
#> Median 0.000
#> Mean 0.113
#> 3rd Qu. 0.000
#> Max. 1.000
#> Warning: Some matrices include stages with survival probability greater than
#> 1.0.
#> NULL
Quickly scanning this output shows a number of differences. First, there are 3 fewer matrices here than in the ahistorical case. There are 3 patches that we are estimating matrices for, and 6 years of data for each patch, leading to 5 possible ahistorical time steps and 15 possible ahistorical matrices. Since historical matrices require 3 years of transition data, only 4 historical transitions are possible per patch, leading to 12 total historical matrices. Second, the dimensionality of the matrices is the square of the dimensions of the ahistorical matrices. This leads to vastly more matrix elements within each matrix, although it turns out that most of these matrix elements are structural 0s because they reflect impossible transitions. Indeed, in this case, although there are 14,641 elements in each matrix, on average only 37.83 are actually estimated greater than 0. Finally, we see that one of our matrices has a survival probability greater than 1.0. This is a problem for us, and normally we would need to correct the situation via the supplemental table. However, for the time being we will proceed (no other MPMs here will have this problem).
Let’s look at the first matrix, corresponding to the transition from 2004 and 2005 to 2006 in the first patch. Because this is a huge matrix, we will only look at the top corner, followed by a middle section. The full matrix is not shown here, but we can focus on portions of it if we wish. These matrices may also be exported to Excel or another spreadsheet program to look over in detail. Particularly note the sparseness - most elements are 0s, because most transitions are actually impossible.
cypmatrix3rp$A[[1]][1:20,1:10]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> [1,] 0.01 0.0 0 0 0 0 0 0 0 0
#> [2,] 0.10 0.0 0 0 0 0 0 0 0 0
#> [3,] 0.00 0.0 0 0 0 0 0 0 0 0
#> [4,] 0.00 0.0 0 0 0 0 0 0 0 0
#> [5,] 0.00 0.0 0 0 0 0 0 0 0 0
#> [6,] 0.00 0.0 0 0 0 0 0 0 0 0
#> [7,] 0.00 0.0 0 0 0 0 0 0 0 0
#> [8,] 0.00 0.0 0 0 0 0 0 0 0 0
#> [9,] 0.00 0.0 0 0 0 0 0 0 0 0
#> [10,] 0.00 0.0 0 0 0 0 0 0 0 0
#> [11,] 0.00 0.0 0 0 0 0 0 0 0 0
#> [12,] 0.00 0.0 0 0 0 0 0 0 0 0
#> [13,] 0.00 0.0 0 0 0 0 0 0 0 0
#> [14,] 0.00 0.1 0 0 0 0 0 0 0 0
#> [15,] 0.00 0.0 0 0 0 0 0 0 0 0
#> [16,] 0.00 0.0 0 0 0 0 0 0 0 0
#> [17,] 0.00 0.0 0 0 0 0 0 0 0 0
#> [18,] 0.00 0.0 0 0 0 0 0 0 0 0
#> [19,] 0.00 0.0 0 0 0 0 0 0 0 0
#> [20,] 0.00 0.0 0 0 0 0 0 0 0 0
print(cypmatrix3rp$A[[1]][66:85,73:81], digits = 3)
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
#> [1,] 0.000 0.000 0 0 0 0 0 0 0
#> [2,] 357.143 0.000 0 0 0 0 0 0 0
#> [3,] 357.143 0.000 0 0 0 0 0 0 0
#> [4,] 0.000 0.000 0 0 0 0 0 0 0
#> [5,] 0.000 0.000 0 0 0 0 0 0 0
#> [6,] 0.000 0.000 0 0 0 0 0 0 0
#> [7,] 0.143 0.000 0 0 0 0 0 0 0
#> [8,] 0.714 0.000 0 0 0 0 0 0 0
#> [9,] 0.000 0.000 0 0 0 0 0 0 0
#> [10,] 0.000 0.000 0 0 0 0 0 0 0
#> [11,] 0.000 0.000 0 0 0 0 0 0 0
#> [12,] 0.000 0.000 0 0 0 0 0 0 0
#> [13,] 0.000 1666.667 0 0 0 0 0 0 0
#> [14,] 0.000 1666.667 0 0 0 0 0 0 0
#> [15,] 0.000 0.000 0 0 0 0 0 0 0
#> [16,] 0.000 0.000 0 0 0 0 0 0 0
#> [17,] 0.000 0.000 0 0 0 0 0 0 0
#> [18,] 0.000 0.000 0 0 0 0 0 0 0
#> [19,] 0.000 0.667 0 0 0 0 0 0 0
#> [20,] 0.000 0.333 0 0 0 0 0 0 0
Now let’s estimate the function-based matrices. Let’s start off with the ahistorical function-based matrix.
cypmatrix2fp <- flefko2(stageframe = cypframe_fb, supplement = cypsupp2_fb,
modelsuite = cypmodels2p, data = cypfb_v1, patch.as.random = TRUE,
year.as.random = TRUE)
summary(cypmatrix2fp)
#>
#> This ahistorical lefkoMat object contains 15 matrices.
#>
#> Each matrix is a square matrix with 54 rows and columns, and a total of 2916 elements.
#> A total of 36150 survival transitions were estimated, with 2410 per matrix.
#> A total of 720 fecundity transitions were estimated, with 48 per matrix.
#>
#> Vital rate modeling quality control:
#>
#> Survival estimated with 74 individuals and 320 individual transitions.
#> Observation estimated with 70 individuals and 303 individual transitions.
#> Size estimated with 70 individuals and 288 individual transitions.
#> Reproductive status estimated with 70 individuals and 288 individual transitions.
#> Fecundity estimated with 51 individuals and 118 individual transitions.
#> Juvenile survival not estimated.
#> Juvenile observation probability not estimated.
#> Juvenile size transition not estimated.
#> Juvenile reproduction probability not estimated.
#>
#> Survival probability sum check (each matrix represented by column in order):
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12]
#> Min. 0.100 0.100 0.100 0.100 0.100 0.100 0.100 0.100 0.100 0.100 0.100 0.100
#> 1st Qu. 0.991 0.991 0.991 0.991 0.991 0.991 0.991 0.991 0.991 0.991 0.991 0.991
#> Median 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
#> Mean 0.919 0.922 0.921 0.921 0.917 0.919 0.921 0.921 0.920 0.917 0.917 0.920
#> 3rd Qu. 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
#> Max. 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
#> [,13] [,14] [,15]
#> Min. 0.100 0.100 0.100
#> 1st Qu. 0.991 0.991 0.991
#> Median 1.000 1.000 1.000
#> Mean 0.919 0.919 0.915
#> 3rd Qu. 1.000 1.000 1.000
#> Max. 1.000 1.000 1.000
#> NULL
Here we have the same number of patches, and patch-level matrices were estimated without us needing to specify anything because patch was a factor in the vital rate models. The same number of matrices were created as in the raw case, but the raw MPM process yielded an average of 21.667 estimated transitions per matrix and only 11 rows and 11 columns matrix per. In contrast, the function-based MPM process led to 2,458 elements per matrix and 54 rows and 54 columns per matrix. This happens because we are using our vital rate models to propagate every matrix element that is biologically possible, and across a wider number of stages. To see the impact, let’s compare the first raw matrix to the first function-based matrix, as below.
writeLines("First matrix in raw ahMPM:")
#> First matrix in raw ahMPM:
print(cypmatrix2rp$A[[1]], digits = 3)
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0.03 0.0 0.0 0.0 0.000 0 0.000 500.0 1666.667 0 0
#> [2,] 0.15 0.0 0.0 0.0 0.000 0 0.000 500.0 1666.667 0 0
#> [3,] 0.00 0.1 0.0 0.0 0.000 0 0.000 0.0 0.000 0 0
#> [4,] 0.00 0.0 0.1 0.0 0.000 0 0.000 0.0 0.000 0 0
#> [5,] 0.00 0.0 0.0 0.1 0.050 0 0.000 0.0 0.000 0 0
#> [6,] 0.00 0.0 0.0 0.0 0.000 0 0.000 0.0 0.000 0 0
#> [7,] 0.00 0.0 0.0 0.0 0.636 0 0.636 0.2 0.000 0 0
#> [8,] 0.00 0.0 0.0 0.0 0.000 0 0.273 0.6 0.667 1 0
#> [9,] 0.00 0.0 0.0 0.0 0.000 0 0.000 0.2 0.333 0 0
#> [10,] 0.00 0.0 0.0 0.0 0.000 0 0.000 0.0 0.000 0 0
#> [11,] 0.00 0.0 0.0 0.0 0.000 0 0.000 0.0 0.000 0 0
writeLines("\nFirst matrix in function-based ahMPM:")
#>
#> First matrix in function-based ahMPM:
print(cypmatrix2fp$A[[1]], digits = 3)
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> [1,] 0.03 0.0 0.0 0.0 0.000 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [2,] 0.15 0.0 0.0 0.0 0.000 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [3,] 0.00 0.1 0.0 0.0 0.000 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [4,] 0.00 0.0 0.1 0.0 0.000 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [5,] 0.00 0.0 0.0 0.1 0.050 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [6,] 0.00 0.0 0.0 0.0 0.047 4.70e-02 3.69e-02 2.81e-02 2.10e-02 1.56e-02
#> [7,] 0.00 0.0 0.0 0.0 0.244 2.44e-01 2.44e-01 2.36e-01 2.22e-01 2.06e-01
#> [8,] 0.00 0.0 0.0 0.0 0.206 2.06e-01 2.11e-01 2.08e-01 2.01e-01 1.90e-01
#> [9,] 0.00 0.0 0.0 0.0 0.000 1.17e-01 1.22e-01 1.23e-01 1.21e-01 1.17e-01
#> [10,] 0.00 0.0 0.0 0.0 0.000 4.94e-02 5.28e-02 5.44e-02 5.48e-02 5.42e-02
#> [11,] 0.00 0.0 0.0 0.0 0.000 1.67e-02 1.83e-02 1.93e-02 1.98e-02 2.00e-02
#> [12,] 0.00 0.0 0.0 0.0 0.000 4.72e-03 5.27e-03 5.68e-03 5.98e-03 6.18e-03
#> [13,] 0.00 0.0 0.0 0.0 0.000 1.14e-03 1.30e-03 1.44e-03 1.54e-03 1.63e-03
#> [14,] 0.00 0.0 0.0 0.0 0.000 2.42e-04 2.82e-04 3.18e-04 3.49e-04 3.77e-04
#> [15,] 0.00 0.0 0.0 0.0 0.000 4.55e-05 5.43e-05 6.25e-05 7.02e-05 7.75e-05
#> [16,] 0.00 0.0 0.0 0.0 0.000 7.71e-06 9.40e-06 1.11e-05 1.27e-05 1.43e-05
#> [17,] 0.00 0.0 0.0 0.0 0.000 1.19e-06 1.48e-06 1.78e-06 2.09e-06 2.41e-06
#> [18,] 0.00 0.0 0.0 0.0 0.000 1.68e-07 2.14e-07 2.63e-07 3.15e-07 3.71e-07
#> [19,] 0.00 0.0 0.0 0.0 0.000 2.19e-08 2.85e-08 3.58e-08 4.38e-08 5.28e-08
#> [20,] 0.00 0.0 0.0 0.0 0.000 2.64e-09 3.52e-09 4.52e-09 5.66e-09 6.97e-09
#> [21,] 0.00 0.0 0.0 0.0 0.000 2.99e-10 4.06e-10 5.33e-10 6.83e-10 8.60e-10
#> [22,] 0.00 0.0 0.0 0.0 0.000 3.16e-11 4.40e-11 5.90e-11 7.73e-11 9.94e-11
#> [23,] 0.00 0.0 0.0 0.0 0.000 3.15e-12 4.48e-12 6.14e-12 8.22e-12 1.08e-11
#> [24,] 0.00 0.0 0.0 0.0 0.000 2.97e-13 4.31e-13 6.04e-13 8.26e-13 1.11e-12
#> [25,] 0.00 0.0 0.0 0.0 0.000 2.64e-14 3.93e-14 5.63e-14 7.87e-14 1.08e-13
#> [26,] 0.00 0.0 0.0 0.0 0.000 2.24e-15 3.40e-15 4.98e-15 7.12e-15 9.99e-15
#> [27,] 0.00 0.0 0.0 0.0 0.000 1.81e-16 2.80e-16 4.20e-16 6.13e-16 8.80e-16
#> [28,] 0.00 0.0 0.0 0.0 0.000 1.39e-17 2.21e-17 3.38e-17 5.04e-17 7.40e-17
#> [29,] 0.00 0.0 0.0 0.0 0.000 1.02e-18 1.66e-18 2.60e-18 3.97e-18 5.95e-18
#> [30,] 0.00 0.0 0.0 0.0 0.000 7.23e-20 1.20e-19 1.92e-19 2.99e-19 4.58e-19
#> [31,] 0.00 0.0 0.0 0.0 0.000 7.58e-02 9.07e-02 1.05e-01 1.18e-01 1.31e-01
#> [32,] 0.00 0.0 0.0 0.0 0.000 6.42e-02 7.85e-02 9.27e-02 1.07e-01 1.21e-01
#> [33,] 0.00 0.0 0.0 0.0 0.000 3.63e-02 4.53e-02 5.47e-02 6.44e-02 7.45e-02
#> [34,] 0.00 0.0 0.0 0.0 0.000 1.54e-02 1.96e-02 2.42e-02 2.91e-02 3.45e-02
#> [35,] 0.00 0.0 0.0 0.0 0.000 5.20e-03 6.80e-03 8.57e-03 1.05e-02 1.27e-02
#> [36,] 0.00 0.0 0.0 0.0 0.000 1.47e-03 1.96e-03 2.53e-03 3.18e-03 3.93e-03
#> [37,] 0.00 0.0 0.0 0.0 0.000 3.55e-04 4.85e-04 6.39e-04 8.22e-04 1.04e-03
#> [38,] 0.00 0.0 0.0 0.0 0.000 7.53e-05 1.05e-04 1.41e-04 1.86e-04 2.40e-04
#> [39,] 0.00 0.0 0.0 0.0 0.000 1.42e-05 2.02e-05 2.78e-05 3.74e-05 4.93e-05
#> [40,] 0.00 0.0 0.0 0.0 0.000 2.40e-06 3.50e-06 4.92e-06 6.76e-06 9.11e-06
#> [41,] 0.00 0.0 0.0 0.0 0.000 3.70e-07 5.51e-07 7.92e-07 1.11e-06 1.53e-06
#> [42,] 0.00 0.0 0.0 0.0 0.000 5.22e-08 7.95e-08 1.17e-07 1.68e-07 2.36e-07
#> [43,] 0.00 0.0 0.0 0.0 0.000 6.80e-09 1.06e-08 1.59e-08 2.33e-08 3.36e-08
#> [44,] 0.00 0.0 0.0 0.0 0.000 8.23e-10 1.31e-09 2.01e-09 3.01e-09 4.44e-09
#> [45,] 0.00 0.0 0.0 0.0 0.000 9.29e-11 1.51e-10 2.37e-10 3.63e-10 5.47e-10
#> [46,] 0.00 0.0 0.0 0.0 0.000 9.84e-12 1.64e-11 2.62e-11 4.11e-11 6.32e-11
#> [47,] 0.00 0.0 0.0 0.0 0.000 9.81e-13 1.67e-12 2.73e-12 4.37e-12 6.88e-12
#> [48,] 0.00 0.0 0.0 0.0 0.000 9.23e-14 1.60e-13 2.69e-13 4.40e-13 7.06e-13
#> [49,] 0.00 0.0 0.0 0.0 0.000 8.23e-15 1.46e-14 2.50e-14 4.19e-14 6.88e-14
#> [50,] 0.00 0.0 0.0 0.0 0.000 6.97e-16 1.26e-15 2.22e-15 3.79e-15 6.36e-15
#> [51,] 0.00 0.0 0.0 0.0 0.000 5.62e-17 1.04e-16 1.87e-16 3.26e-16 5.60e-16
#> [52,] 0.00 0.0 0.0 0.0 0.000 4.33e-18 8.21e-18 1.50e-17 2.68e-17 4.71e-17
#> [53,] 0.00 0.0 0.0 0.0 0.000 3.19e-19 6.18e-19 1.16e-18 2.11e-18 3.78e-18
#> [54,] 0.00 0.0 0.0 0.0 0.000 2.25e-20 4.46e-20 8.52e-20 1.59e-19 2.91e-19
#> [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18]
#> [1,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [2,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [3,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [4,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [5,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [6,] 1.15e-02 8.47e-03 6.21e-03 4.55e-03 3.33e-03 2.44e-03 1.78e-03 1.30e-03
#> [7,] 1.88e-01 1.69e-01 1.51e-01 1.34e-01 1.17e-01 1.02e-01 8.74e-02 7.47e-02
#> [8,] 1.77e-01 1.64e-01 1.49e-01 1.35e-01 1.21e-01 1.07e-01 9.43e-02 8.23e-02
#> [9,] 1.12e-01 1.05e-01 9.83e-02 9.08e-02 8.31e-02 7.53e-02 6.77e-02 6.04e-02
#> [10,] 5.28e-02 5.09e-02 4.85e-02 4.58e-02 4.29e-02 3.97e-02 3.65e-02 3.33e-02
#> [11,] 2.00e-02 1.97e-02 1.92e-02 1.85e-02 1.77e-02 1.68e-02 1.57e-02 1.47e-02
#> [12,] 6.29e-03 6.34e-03 6.31e-03 6.22e-03 6.08e-03 5.89e-03 5.65e-03 5.39e-03
#> [13,] 1.70e-03 1.75e-03 1.78e-03 1.79e-03 1.79e-03 1.77e-03 1.74e-03 1.70e-03
#> [14,] 4.01e-04 4.22e-04 4.40e-04 4.53e-04 4.62e-04 4.68e-04 4.69e-04 4.67e-04
#> [15,] 8.43e-05 9.07e-05 9.64e-05 1.02e-04 1.06e-04 1.10e-04 1.12e-04 1.14e-04
#> [16,] 1.59e-05 1.75e-05 1.90e-05 2.05e-05 2.19e-05 2.31e-05 2.42e-05 2.52e-05
#> [17,] 2.74e-06 3.08e-06 3.42e-06 3.76e-06 4.10e-06 4.43e-06 4.75e-06 5.05e-06
#> [18,] 4.31e-07 4.95e-07 5.63e-07 6.33e-07 7.05e-07 7.79e-07 8.53e-07 9.27e-07
#> [19,] 6.27e-08 7.36e-08 8.55e-08 9.83e-08 1.12e-07 1.26e-07 1.41e-07 1.57e-07
#> [20,] 8.47e-09 1.02e-08 1.21e-08 1.42e-08 1.65e-08 1.90e-08 2.18e-08 2.47e-08
#> [21,] 1.07e-09 1.31e-09 1.59e-09 1.91e-09 2.27e-09 2.68e-09 3.13e-09 3.63e-09
#> [22,] 1.26e-10 1.58e-10 1.96e-10 2.41e-10 2.93e-10 3.53e-10 4.22e-10 5.00e-10
#> [23,] 1.40e-11 1.80e-11 2.28e-11 2.86e-11 3.55e-11 4.38e-11 5.35e-11 6.48e-11
#> [24,] 1.47e-12 1.93e-12 2.50e-12 3.20e-12 4.07e-12 5.13e-12 6.40e-12 7.94e-12
#> [25,] 1.46e-13 1.96e-13 2.60e-13 3.40e-13 4.42e-13 5.69e-13 7.27e-13 9.20e-13
#> [26,] 1.38e-14 1.89e-14 2.56e-14 3.44e-14 4.56e-14 6.00e-14 7.83e-14 1.01e-13
#> [27,] 1.25e-15 1.74e-15 2.41e-15 3.30e-15 4.48e-15 6.03e-15 8.04e-15 1.06e-14
#> [28,] 1.07e-16 1.53e-16 2.16e-16 3.03e-16 4.20e-16 5.78e-16 7.88e-16 1.07e-15
#> [29,] 8.80e-18 1.29e-17 1.86e-17 2.66e-17 3.77e-17 5.30e-17 7.38e-17 1.02e-16
#> [30,] 6.93e-19 1.03e-18 1.53e-18 2.24e-18 3.24e-18 4.66e-18 6.63e-18 9.37e-18
#> [31,] 1.43e-01 1.54e-01 1.64e-01 1.74e-01 1.82e-01 1.89e-01 1.94e-01 1.98e-01
#> [32,] 1.35e-01 1.49e-01 1.62e-01 1.75e-01 1.88e-01 1.99e-01 2.10e-01 2.19e-01
#> [33,] 8.50e-02 9.59e-02 1.07e-01 1.18e-01 1.29e-01 1.40e-01 1.51e-01 1.61e-01
#> [34,] 4.02e-02 4.63e-02 5.28e-02 5.96e-02 6.66e-02 7.38e-02 8.11e-02 8.85e-02
#> [35,] 1.52e-02 1.79e-02 2.09e-02 2.41e-02 2.75e-02 3.11e-02 3.50e-02 3.90e-02
#> [36,] 4.79e-03 5.76e-03 6.86e-03 8.09e-03 9.45e-03 1.09e-02 1.26e-02 1.43e-02
#> [37,] 1.29e-03 1.59e-03 1.94e-03 2.33e-03 2.79e-03 3.30e-03 3.87e-03 4.51e-03
#> [38,] 3.05e-04 3.84e-04 4.78e-04 5.89e-04 7.19e-04 8.70e-04 1.04e-03 1.24e-03
#> [39,] 6.41e-05 8.24e-05 1.05e-04 1.32e-04 1.65e-04 2.04e-04 2.50e-04 3.04e-04
#> [40,] 1.21e-05 1.59e-05 2.07e-05 2.67e-05 3.40e-05 4.30e-05 5.39e-05 6.70e-05
#> [41,] 2.08e-06 2.80e-06 3.72e-06 4.89e-06 6.38e-06 8.24e-06 1.06e-05 1.34e-05
#> [42,] 3.28e-07 4.50e-07 6.12e-07 8.23e-07 1.10e-06 1.45e-06 1.90e-06 2.46e-06
#> [43,] 4.77e-08 6.69e-08 9.30e-08 1.28e-07 1.74e-07 2.35e-07 3.14e-07 4.18e-07
#> [44,] 6.44e-09 9.24e-09 1.31e-08 1.84e-08 2.56e-08 3.54e-08 4.84e-08 6.57e-08
#> [45,] 8.12e-10 1.19e-09 1.73e-09 2.48e-09 3.53e-09 4.98e-09 6.96e-09 9.65e-09
#> [46,] 9.59e-11 1.44e-10 2.13e-10 3.13e-10 4.55e-10 6.56e-10 9.38e-10 1.33e-09
#> [47,] 1.07e-11 1.63e-11 2.48e-11 3.71e-11 5.52e-11 8.14e-11 1.19e-10 1.72e-10
#> [48,] 1.12e-12 1.75e-12 2.72e-12 4.17e-12 6.33e-12 9.53e-12 1.42e-11 2.11e-11
#> [49,] 1.11e-13 1.78e-13 2.82e-13 4.43e-13 6.87e-13 1.06e-12 1.62e-12 2.45e-12
#> [50,] 1.05e-14 1.72e-14 2.79e-14 4.47e-14 7.09e-14 1.12e-13 1.74e-13 2.70e-13
#> [51,] 9.47e-16 1.58e-15 2.62e-15 4.29e-15 6.97e-15 1.12e-14 1.79e-14 2.83e-14
#> [52,] 8.14e-17 1.39e-16 2.35e-16 3.94e-16 6.53e-16 1.07e-15 1.75e-15 2.83e-15
#> [53,] 6.69e-18 1.17e-17 2.02e-17 3.46e-17 5.86e-17 9.85e-17 1.64e-16 2.71e-16
#> [54,] 5.27e-19 9.41e-19 1.66e-18 2.91e-18 5.04e-18 8.66e-18 1.47e-17 2.49e-17
#> [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26]
#> [1,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [2,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [3,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [4,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [5,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [6,] 9.54e-04 6.97e-04 5.10e-04 3.73e-04 2.72e-04 1.99e-04 1.46e-04 1.06e-04
#> [7,] 6.33e-02 5.33e-02 4.46e-02 3.71e-02 3.07e-02 2.53e-02 2.07e-02 1.69e-02
#> [8,] 7.13e-02 6.13e-02 5.24e-02 4.46e-02 3.77e-02 3.17e-02 2.66e-02 2.22e-02
#> [9,] 5.35e-02 4.71e-02 4.11e-02 3.57e-02 3.09e-02 2.66e-02 2.28e-02 1.94e-02
#> [10,] 3.01e-02 2.71e-02 2.42e-02 2.15e-02 1.90e-02 1.67e-02 1.46e-02 1.28e-02
#> [11,] 1.36e-02 1.25e-02 1.14e-02 1.03e-02 9.34e-03 8.40e-03 7.52e-03 6.70e-03
#> [12,] 5.09e-03 4.78e-03 4.47e-03 4.14e-03 3.83e-03 3.52e-03 3.22e-03 2.93e-03
#> [13,] 1.64e-03 1.57e-03 1.50e-03 1.42e-03 1.34e-03 1.26e-03 1.18e-03 1.10e-03
#> [14,] 4.61e-04 4.53e-04 4.42e-04 4.28e-04 4.13e-04 3.97e-04 3.79e-04 3.61e-04
#> [15,] 1.15e-04 1.16e-04 1.15e-04 1.14e-04 1.13e-04 1.11e-04 1.08e-04 1.05e-04
#> [16,] 2.60e-05 2.67e-05 2.72e-05 2.75e-05 2.77e-05 2.78e-05 2.78e-05 2.77e-05
#> [17,] 5.33e-06 5.58e-06 5.81e-06 6.02e-06 6.20e-06 6.36e-06 6.49e-06 6.60e-06
#> [18,] 1.00e-06 1.07e-06 1.14e-06 1.21e-06 1.27e-06 1.33e-06 1.39e-06 1.44e-06
#> [19,] 1.73e-07 1.90e-07 2.06e-07 2.23e-07 2.40e-07 2.57e-07 2.75e-07 2.92e-07
#> [20,] 2.79e-08 3.12e-08 3.47e-08 3.84e-08 4.22e-08 4.62e-08 5.04e-08 5.47e-08
#> [21,] 4.18e-09 4.79e-09 5.44e-09 6.15e-09 6.92e-09 7.74e-09 8.63e-09 9.58e-09
#> [22,] 5.89e-10 6.89e-10 8.00e-10 9.25e-10 1.06e-09 1.22e-09 1.38e-09 1.57e-09
#> [23,] 7.80e-11 9.33e-11 1.11e-10 1.31e-10 1.54e-10 1.80e-10 2.09e-10 2.43e-10
#> [24,] 9.76e-12 1.19e-11 1.45e-11 1.75e-11 2.10e-11 2.51e-11 2.99e-11 3.54e-11
#> [25,] 1.16e-12 1.45e-12 1.79e-12 2.21e-12 2.72e-12 3.32e-12 4.04e-12 4.89e-12
#> [26,] 1.30e-13 1.66e-13 2.11e-13 2.66e-13 3.34e-13 4.17e-13 5.18e-13 6.42e-13
#> [27,] 1.40e-14 1.82e-14 2.36e-14 3.05e-14 3.91e-14 4.99e-14 6.34e-14 8.03e-14
#> [28,] 1.43e-15 1.91e-15 2.53e-15 3.33e-15 4.37e-15 5.70e-15 7.41e-15 9.58e-15
#> [29,] 1.40e-16 1.91e-16 2.59e-16 3.49e-16 4.67e-16 6.23e-16 8.27e-16 1.09e-15
#> [30,] 1.32e-17 1.83e-17 2.54e-17 3.49e-17 4.78e-17 6.52e-17 8.85e-17 1.20e-16
#> [31,] 2.01e-01 2.02e-01 2.03e-01 2.01e-01 1.99e-01 1.96e-01 1.92e-01 1.88e-01
#> [32,] 2.27e-01 2.33e-01 2.38e-01 2.42e-01 2.45e-01 2.47e-01 2.47e-01 2.47e-01
#> [33,] 1.70e-01 1.79e-01 1.87e-01 1.94e-01 2.01e-01 2.07e-01 2.12e-01 2.16e-01
#> [34,] 9.58e-02 1.03e-01 1.10e-01 1.17e-01 1.23e-01 1.30e-01 1.36e-01 1.42e-01
#> [35,] 4.31e-02 4.74e-02 5.17e-02 5.62e-02 6.07e-02 6.52e-02 6.98e-02 7.44e-02
#> [36,] 1.62e-02 1.82e-02 2.03e-02 2.25e-02 2.49e-02 2.73e-02 2.99e-02 3.26e-02
#> [37,] 5.21e-03 5.98e-03 6.82e-03 7.74e-03 8.73e-03 9.81e-03 1.10e-02 1.22e-02
#> [38,] 1.47e-03 1.72e-03 2.01e-03 2.33e-03 2.68e-03 3.08e-03 3.52e-03 4.01e-03
#> [39,] 3.67e-04 4.40e-04 5.25e-04 6.22e-04 7.33e-04 8.60e-04 1.01e-03 1.17e-03
#> [40,] 8.27e-05 1.01e-04 1.23e-04 1.50e-04 1.80e-04 2.16e-04 2.58e-04 3.07e-04
#> [41,] 1.69e-05 2.12e-05 2.64e-05 3.27e-05 4.03e-05 4.94e-05 6.03e-05 7.33e-05
#> [42,] 3.18e-06 4.07e-06 5.18e-06 6.56e-06 8.25e-06 1.03e-05 1.29e-05 1.60e-05
#> [43,] 5.50e-07 7.21e-07 9.38e-07 1.21e-06 1.56e-06 2.00e-06 2.55e-06 3.24e-06
#> [44,] 8.86e-08 1.19e-07 1.58e-07 2.08e-07 2.74e-07 3.59e-07 4.68e-07 6.08e-07
#> [45,] 1.33e-08 1.82e-08 2.47e-08 3.34e-08 4.49e-08 6.01e-08 8.01e-08 1.06e-07
#> [46,] 1.87e-09 2.62e-09 3.64e-09 5.02e-09 6.90e-09 9.44e-09 1.29e-08 1.75e-08
#> [47,] 2.48e-10 3.54e-10 5.03e-10 7.11e-10 9.99e-10 1.40e-09 1.94e-09 2.70e-09
#> [48,] 3.10e-11 4.53e-11 6.58e-11 9.50e-11 1.36e-10 1.95e-10 2.77e-10 3.93e-10
#> [49,] 3.68e-12 5.49e-12 8.15e-12 1.20e-11 1.76e-11 2.58e-11 3.75e-11 5.43e-11
#> [50,] 4.14e-13 6.32e-13 9.59e-13 1.45e-12 2.17e-12 3.24e-12 4.82e-12 7.13e-12
#> [51,] 4.44e-14 6.93e-14 1.07e-13 1.66e-13 2.54e-13 3.88e-13 5.89e-13 8.92e-13
#> [52,] 4.55e-15 7.25e-15 1.15e-14 1.81e-14 2.84e-14 4.43e-14 6.88e-14 1.06e-13
#> [53,] 4.45e-16 7.26e-16 1.18e-15 1.89e-15 3.03e-15 4.84e-15 7.68e-15 1.22e-14
#> [54,] 4.18e-17 6.96e-17 1.15e-16 1.90e-16 3.11e-16 5.07e-16 8.22e-16 1.33e-15
#> [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34]
#> [1,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 2.31e+03 1.77e+03 8.24e+02 2.26e+02
#> [2,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 2.31e+03 1.77e+03 8.24e+02 2.26e+02
#> [3,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [4,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [5,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [6,] 7.78e-05 5.69e-05 4.16e-05 3.04e-05 3.69e-02 2.81e-02 2.10e-02 1.56e-02
#> [7,] 1.38e-02 1.12e-02 9.04e-03 7.30e-03 1.21e-01 1.10e-01 9.67e-02 8.39e-02
#> [8,] 1.85e-02 1.53e-02 1.27e-02 1.05e-02 1.05e-01 9.70e-02 8.75e-02 7.76e-02
#> [9,] 1.65e-02 1.40e-02 1.18e-02 9.99e-03 6.06e-02 5.72e-02 5.28e-02 4.78e-02
#> [10,] 1.11e-02 9.61e-03 8.31e-03 7.16e-03 2.62e-02 2.53e-02 2.39e-02 2.21e-02
#> [11,] 5.96e-03 5.27e-03 4.66e-03 4.10e-03 9.08e-03 8.96e-03 8.63e-03 8.18e-03
#> [12,] 2.66e-03 2.41e-03 2.18e-03 1.96e-03 2.62e-03 2.64e-03 2.60e-03 2.52e-03
#> [13,] 1.02e-03 9.45e-04 8.72e-04 8.02e-04 6.48e-04 6.69e-04 6.73e-04 6.66e-04
#> [14,] 3.43e-04 3.24e-04 3.06e-04 2.87e-04 1.40e-04 1.48e-04 1.52e-04 1.54e-04
#> [15,] 1.02e-04 9.88e-05 9.52e-05 9.15e-05 2.70e-05 2.91e-05 3.06e-05 3.16e-05
#> [16,] 2.74e-05 2.71e-05 2.67e-05 2.62e-05 4.67e-06 5.15e-06 5.53e-06 5.85e-06
#> [17,] 6.69e-06 6.76e-06 6.81e-06 6.84e-06 7.36e-07 8.28e-07 9.10e-07 9.83e-07
#> [18,] 1.50e-06 1.54e-06 1.59e-06 1.63e-06 1.06e-07 1.22e-07 1.37e-07 1.51e-07
#> [19,] 3.09e-07 3.26e-07 3.43e-07 3.60e-07 1.41e-08 1.66e-08 1.91e-08 2.15e-08
#> [20,] 5.92e-08 6.39e-08 6.87e-08 7.37e-08 1.75e-09 2.10e-09 2.47e-09 2.85e-09
#> [21,] 1.06e-08 1.17e-08 1.28e-08 1.41e-08 2.02e-10 2.48e-10 2.98e-10 3.51e-10
#> [22,] 1.78e-09 2.00e-09 2.25e-09 2.52e-09 2.19e-11 2.75e-11 3.37e-11 4.06e-11
#> [23,] 2.81e-10 3.23e-10 3.71e-10 4.25e-10 2.23e-12 2.86e-12 3.58e-12 4.41e-12
#> [24,] 4.18e-11 4.93e-11 5.78e-11 6.77e-11 2.14e-13 2.81e-13 3.60e-13 4.53e-13
#> [25,] 5.91e-12 7.11e-12 8.53e-12 1.02e-11 1.95e-14 2.62e-14 3.43e-14 4.41e-14
#> [26,] 7.93e-13 9.75e-13 1.20e-12 1.46e-12 1.69e-15 2.32e-15 3.10e-15 4.08e-15
#> [27,] 1.01e-13 1.27e-13 1.60e-13 2.00e-13 1.39e-16 1.95e-16 2.67e-16 3.59e-16
#> [28,] 1.24e-14 1.59e-14 2.04e-14 2.60e-14 1.10e-17 1.57e-17 2.20e-17 3.02e-17
#> [29,] 1.44e-15 1.89e-15 2.48e-15 3.24e-15 8.26e-19 1.21e-18 1.73e-18 2.43e-18
#> [30,] 1.61e-16 2.17e-16 2.90e-16 3.87e-16 5.96e-20 8.92e-20 1.30e-19 1.87e-19
#> [31,] 1.83e-01 1.78e-01 1.72e-01 1.66e-01 2.13e-01 2.31e-01 2.43e-01 2.53e-01
#> [32,] 2.46e-01 2.43e-01 2.41e-01 2.37e-01 1.85e-01 2.04e-01 2.20e-01 2.33e-01
#> [33,] 2.20e-01 2.23e-01 2.25e-01 2.27e-01 1.07e-01 1.20e-01 1.33e-01 1.44e-01
#> [34,] 1.47e-01 1.53e-01 1.58e-01 1.63e-01 4.62e-02 5.33e-02 6.01e-02 6.65e-02
#> [35,] 7.91e-02 8.38e-02 8.85e-02 9.32e-02 1.60e-02 1.89e-02 2.17e-02 2.46e-02
#> [36,] 3.54e-02 3.83e-02 4.13e-02 4.45e-02 4.61e-03 5.57e-03 6.55e-03 7.58e-03
#> [37,] 1.36e-02 1.50e-02 1.66e-02 1.82e-02 1.14e-03 1.41e-03 1.69e-03 2.00e-03
#> [38,] 4.55e-03 5.15e-03 5.80e-03 6.53e-03 2.47e-04 3.11e-04 3.83e-04 4.63e-04
#> [39,] 1.36e-03 1.57e-03 1.81e-03 2.08e-03 4.75e-05 6.12e-05 7.70e-05 9.52e-05
#> [40,] 3.64e-04 4.30e-04 5.07e-04 5.96e-04 8.23e-06 1.08e-05 1.39e-05 1.76e-05
#> [41,] 8.89e-05 1.07e-04 1.29e-04 1.55e-04 1.30e-06 1.74e-06 2.29e-06 2.96e-06
#> [42,] 1.99e-05 2.45e-05 3.02e-05 3.71e-05 1.87e-07 2.57e-07 3.45e-07 4.56e-07
#> [43,] 4.10e-06 5.18e-06 6.51e-06 8.17e-06 2.49e-08 3.50e-08 4.81e-08 6.48e-08
#> [44,] 7.86e-07 1.01e-06 1.30e-06 1.67e-06 3.08e-09 4.43e-09 6.21e-09 8.56e-09
#> [45,] 1.41e-07 1.86e-07 2.44e-07 3.20e-07 3.55e-10 5.22e-10 7.49e-10 1.06e-09
#> [46,] 2.36e-08 3.18e-08 4.27e-08 5.73e-08 3.85e-11 5.78e-11 8.47e-11 1.22e-10
#> [47,] 3.73e-09 5.13e-09 7.05e-09 9.66e-09 3.92e-12 6.02e-12 9.01e-12 1.33e-11
#> [48,] 5.56e-10 7.82e-10 1.10e-09 1.54e-09 3.77e-13 5.92e-13 9.06e-13 1.36e-12
#> [49,] 7.85e-11 1.13e-10 1.62e-10 2.32e-10 3.44e-14 5.51e-14 8.63e-14 1.33e-13
#> [50,] 1.05e-11 1.55e-11 2.27e-11 3.32e-11 2.97e-15 4.88e-15 7.80e-15 1.23e-14
#> [51,] 1.35e-12 2.02e-12 3.03e-12 4.54e-12 2.45e-16 4.11e-16 6.72e-16 1.08e-15
#> [52,] 1.64e-13 2.52e-13 3.87e-13 5.91e-13 1.93e-17 3.31e-17 5.53e-17 9.08e-17
#> [53,] 1.92e-14 3.01e-14 4.71e-14 7.36e-14 1.45e-18 2.54e-18 4.35e-18 7.30e-18
#> [54,] 2.14e-15 3.44e-15 5.51e-15 8.80e-15 1.05e-19 1.88e-19 3.28e-19 5.63e-19
#> [,35] [,36] [,37] [,38] [,39] [,40] [,41] [,42]
#> [1,] 4.94e+01 1.02e+01 2.06e+00 4.18e-01 8.47e-02 1.71e-02 3.47e-03 7.03e-04
#> [2,] 4.94e+01 1.02e+01 2.06e+00 4.18e-01 8.47e-02 1.71e-02 3.47e-03 7.03e-04
#> [3,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [4,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [5,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [6,] 1.15e-02 8.47e-03 6.21e-03 4.55e-03 3.33e-03 2.44e-03 1.78e-03 1.30e-03
#> [7,] 7.19e-02 6.10e-02 5.14e-02 4.30e-02 3.58e-02 2.97e-02 2.45e-02 2.01e-02
#> [8,] 6.79e-02 5.89e-02 5.07e-02 4.34e-02 3.69e-02 3.13e-02 2.64e-02 2.22e-02
#> [9,] 4.28e-02 3.80e-02 3.34e-02 2.92e-02 2.54e-02 2.20e-02 1.90e-02 1.63e-02
#> [10,] 2.02e-02 1.83e-02 1.65e-02 1.47e-02 1.31e-02 1.16e-02 1.02e-02 8.97e-03
#> [11,] 7.65e-03 7.08e-03 6.51e-03 5.95e-03 5.41e-03 4.89e-03 4.40e-03 3.95e-03
#> [12,] 2.41e-03 2.28e-03 2.14e-03 2.00e-03 1.86e-03 1.72e-03 1.58e-03 1.45e-03
#> [13,] 6.51e-04 6.30e-04 6.05e-04 5.77e-04 5.48e-04 5.18e-04 4.87e-04 4.57e-04
#> [14,] 1.54e-04 1.52e-04 1.49e-04 1.46e-04 1.41e-04 1.37e-04 1.31e-04 1.26e-04
#> [15,] 3.23e-05 3.26e-05 3.28e-05 3.27e-05 3.24e-05 3.20e-05 3.15e-05 3.08e-05
#> [16,] 6.10e-06 6.31e-06 6.47e-06 6.59e-06 6.69e-06 6.75e-06 6.78e-06 6.79e-06
#> [17,] 1.05e-06 1.11e-06 1.16e-06 1.21e-06 1.25e-06 1.29e-06 1.33e-06 1.36e-06
#> [18,] 1.65e-07 1.78e-07 1.91e-07 2.04e-07 2.16e-07 2.27e-07 2.39e-07 2.50e-07
#> [19,] 2.40e-08 2.65e-08 2.90e-08 3.16e-08 3.42e-08 3.69e-08 3.96e-08 4.23e-08
#> [20,] 3.24e-09 3.66e-09 4.10e-09 4.56e-09 5.04e-09 5.56e-09 6.09e-09 6.66e-09
#> [21,] 4.09e-10 4.71e-10 5.39e-10 6.13e-10 6.94e-10 7.81e-10 8.76e-10 9.79e-10
#> [22,] 4.83e-11 5.69e-11 6.66e-11 7.74e-11 8.95e-11 1.03e-10 1.18e-10 1.35e-10
#> [23,] 5.37e-12 6.47e-12 7.73e-12 9.19e-12 1.09e-11 1.28e-11 1.50e-11 1.75e-11
#> [24,] 5.64e-13 6.94e-13 8.48e-13 1.03e-12 1.24e-12 1.50e-12 1.79e-12 2.14e-12
#> [25,] 5.61e-14 7.06e-14 8.82e-14 1.09e-13 1.35e-13 1.66e-13 2.03e-13 2.48e-13
#> [26,] 5.30e-15 6.82e-15 8.71e-15 1.10e-14 1.39e-14 1.75e-14 2.19e-14 2.73e-14
#> [27,] 4.77e-16 6.27e-16 8.19e-16 1.06e-15 1.37e-15 1.76e-15 2.25e-15 2.87e-15
#> [28,] 4.10e-17 5.51e-17 7.35e-17 9.75e-17 1.29e-16 1.69e-16 2.20e-16 2.87e-16
#> [29,] 3.37e-18 4.63e-18 6.31e-18 8.55e-18 1.15e-17 1.55e-17 2.07e-17 2.75e-17
#> [30,] 2.65e-19 3.73e-19 5.19e-19 7.19e-19 9.91e-19 1.36e-18 1.86e-18 2.53e-18
#> [31,] 2.59e-01 2.63e-01 2.64e-01 2.65e-01 2.63e-01 2.61e-01 2.57e-01 2.53e-01
#> [32,] 2.44e-01 2.54e-01 2.61e-01 2.67e-01 2.72e-01 2.75e-01 2.77e-01 2.79e-01
#> [33,] 1.54e-01 1.63e-01 1.72e-01 1.80e-01 1.87e-01 1.93e-01 1.99e-01 2.05e-01
#> [34,] 7.28e-02 7.89e-02 8.48e-02 9.07e-02 9.64e-02 1.02e-01 1.07e-01 1.13e-01
#> [35,] 2.75e-02 3.05e-02 3.35e-02 3.66e-02 3.98e-02 4.30e-02 4.63e-02 4.97e-02
#> [36,] 8.67e-03 9.82e-03 1.10e-02 1.23e-02 1.37e-02 1.51e-02 1.66e-02 1.83e-02
#> [37,] 2.34e-03 2.71e-03 3.11e-03 3.55e-03 4.03e-03 4.55e-03 5.13e-03 5.75e-03
#> [38,] 5.53e-04 6.54e-04 7.68e-04 8.96e-04 1.04e-03 1.20e-03 1.38e-03 1.58e-03
#> [39,] 1.16e-04 1.40e-04 1.69e-04 2.01e-04 2.38e-04 2.81e-04 3.31e-04 3.87e-04
#> [40,] 2.20e-05 2.71e-05 3.33e-05 4.06e-05 4.92e-05 5.93e-05 7.13e-05 8.54e-05
#> [41,] 3.77e-06 4.77e-06 5.98e-06 7.45e-06 9.23e-06 1.14e-05 1.40e-05 1.71e-05
#> [42,] 5.94e-07 7.67e-07 9.84e-07 1.25e-06 1.59e-06 2.00e-06 2.51e-06 3.14e-06
#> [43,] 8.64e-08 1.14e-07 1.49e-07 1.94e-07 2.52e-07 3.24e-07 4.16e-07 5.32e-07
#> [44,] 1.17e-08 1.57e-08 2.11e-08 2.80e-08 3.71e-08 4.89e-08 6.41e-08 8.38e-08
#> [45,] 1.47e-09 2.03e-09 2.77e-09 3.77e-09 5.10e-09 6.87e-09 9.21e-09 1.23e-08
#> [46,] 1.74e-10 2.45e-10 3.42e-10 4.76e-10 6.58e-10 9.06e-10 1.24e-09 1.69e-09
#> [47,] 1.93e-11 2.78e-11 3.98e-11 5.65e-11 7.99e-11 1.12e-10 1.57e-10 2.20e-10
#> [48,] 2.03e-12 2.99e-12 4.37e-12 6.34e-12 9.16e-12 1.32e-11 1.89e-11 2.69e-11
#> [49,] 2.02e-13 3.04e-13 4.54e-13 6.73e-13 9.94e-13 1.46e-12 2.14e-12 3.12e-12
#> [50,] 1.91e-14 2.93e-14 4.48e-14 6.80e-14 1.03e-13 1.54e-13 2.31e-13 3.44e-13
#> [51,] 1.72e-15 2.70e-15 4.21e-15 6.53e-15 1.01e-14 1.55e-14 2.37e-14 3.61e-14
#> [52,] 1.47e-16 2.37e-16 3.78e-16 6.00e-16 9.45e-16 1.48e-15 2.32e-15 3.61e-15
#> [53,] 1.21e-17 1.99e-17 3.25e-17 5.26e-17 8.48e-17 1.36e-16 2.17e-16 3.46e-16
#> [54,] 9.54e-19 1.60e-18 2.67e-18 4.43e-18 7.29e-18 1.20e-17 1.95e-17 3.18e-17
#> [,43] [,44] [,45] [,46] [,47] [,48] [,49] [,50]
#> [1,] 1.42e-04 2.88e-05 5.84e-06 1.18e-06 2.39e-07 4.85e-08 9.81e-09 1.99e-09
#> [2,] 1.42e-04 2.88e-05 5.84e-06 1.18e-06 2.39e-07 4.85e-08 9.81e-09 1.99e-09
#> [3,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [4,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [5,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [6,] 9.54e-04 6.97e-04 5.10e-04 3.73e-04 2.72e-04 1.99e-04 1.46e-04 1.06e-04
#> [7,] 1.65e-02 1.35e-02 1.10e-02 8.93e-03 7.24e-03 5.87e-03 4.74e-03 3.83e-03
#> [8,] 1.86e-02 1.55e-02 1.29e-02 1.07e-02 8.91e-03 7.37e-03 6.09e-03 5.02e-03
#> [9,] 1.39e-02 1.19e-02 1.01e-02 8.61e-03 7.30e-03 6.17e-03 5.21e-03 4.40e-03
#> [10,] 7.85e-03 6.85e-03 5.96e-03 5.18e-03 4.49e-03 3.88e-03 3.35e-03 2.89e-03
#> [11,] 3.54e-03 3.15e-03 2.81e-03 2.49e-03 2.21e-03 1.95e-03 1.72e-03 1.52e-03
#> [12,] 1.33e-03 1.21e-03 1.10e-03 9.98e-04 9.04e-04 8.17e-04 7.36e-04 6.63e-04
#> [13,] 4.27e-04 3.98e-04 3.70e-04 3.43e-04 3.17e-04 2.93e-04 2.70e-04 2.49e-04
#> [14,] 1.20e-04 1.15e-04 1.09e-04 1.03e-04 9.76e-05 9.21e-05 8.68e-05 8.16e-05
#> [15,] 3.01e-05 2.93e-05 2.85e-05 2.76e-05 2.67e-05 2.57e-05 2.48e-05 2.38e-05
#> [16,] 6.78e-06 6.74e-06 6.70e-06 6.63e-06 6.55e-06 6.46e-06 6.36e-06 6.25e-06
#> [17,] 1.39e-06 1.41e-06 1.43e-06 1.45e-06 1.46e-06 1.48e-06 1.49e-06 1.49e-06
#> [18,] 2.60e-07 2.71e-07 2.81e-07 2.91e-07 3.00e-07 3.09e-07 3.18e-07 3.27e-07
#> [19,] 4.51e-08 4.80e-08 5.08e-08 5.38e-08 5.67e-08 5.98e-08 6.28e-08 6.59e-08
#> [20,] 7.26e-09 7.89e-09 8.55e-09 9.24e-09 9.97e-09 1.07e-08 1.15e-08 1.24e-08
#> [21,] 1.09e-09 1.21e-09 1.34e-09 1.48e-09 1.63e-09 1.80e-09 1.97e-09 2.16e-09
#> [22,] 1.53e-10 1.74e-10 1.97e-10 2.23e-10 2.51e-10 2.82e-10 3.17e-10 3.55e-10
#> [23,] 2.03e-11 2.36e-11 2.73e-11 3.15e-11 3.63e-11 4.17e-11 4.79e-11 5.49e-11
#> [24,] 2.54e-12 3.02e-12 3.57e-12 4.21e-12 4.96e-12 5.83e-12 6.83e-12 8.00e-12
#> [25,] 3.01e-13 3.65e-13 4.42e-13 5.33e-13 6.42e-13 7.71e-13 9.24e-13 1.11e-12
#> [26,] 3.40e-14 4.21e-14 5.20e-14 6.41e-14 7.89e-14 9.68e-14 1.19e-13 1.45e-13
#> [27,] 3.64e-15 4.61e-15 5.83e-15 7.34e-15 9.23e-15 1.16e-14 1.45e-14 1.82e-14
#> [28,] 3.73e-16 4.83e-16 6.23e-16 8.03e-16 1.03e-15 1.32e-15 1.69e-15 2.17e-15
#> [29,] 3.65e-17 4.83e-17 6.38e-17 8.40e-17 1.10e-16 1.45e-16 1.89e-16 2.47e-16
#> [30,] 3.43e-18 4.63e-18 6.25e-18 8.41e-18 1.13e-17 1.51e-17 2.03e-17 2.71e-17
#> [31,] 2.48e-01 2.42e-01 2.36e-01 2.30e-01 2.23e-01 2.16e-01 2.08e-01 2.01e-01
#> [32,] 2.79e-01 2.79e-01 2.78e-01 2.76e-01 2.74e-01 2.71e-01 2.68e-01 2.64e-01
#> [33,] 2.10e-01 2.14e-01 2.18e-01 2.21e-01 2.24e-01 2.27e-01 2.29e-01 2.31e-01
#> [34,] 1.18e-01 1.23e-01 1.28e-01 1.33e-01 1.38e-01 1.43e-01 1.47e-01 1.52e-01
#> [35,] 5.32e-02 5.67e-02 6.03e-02 6.40e-02 6.78e-02 7.17e-02 7.56e-02 7.96e-02
#> [36,] 2.00e-02 2.18e-02 2.37e-02 2.57e-02 2.78e-02 3.00e-02 3.24e-02 3.48e-02
#> [37,] 6.42e-03 7.16e-03 7.95e-03 8.82e-03 9.76e-03 1.08e-02 1.19e-02 1.31e-02
#> [38,] 1.81e-03 2.06e-03 2.34e-03 2.65e-03 3.00e-03 3.39e-03 3.81e-03 4.29e-03
#> [39,] 4.52e-04 5.27e-04 6.12e-04 7.09e-04 8.19e-04 9.45e-04 1.09e-03 1.25e-03
#> [40,] 1.02e-04 1.21e-04 1.44e-04 1.70e-04 2.01e-04 2.38e-04 2.80e-04 3.29e-04
#> [41,] 2.09e-05 2.54e-05 3.08e-05 3.73e-05 4.50e-05 5.43e-05 6.53e-05 7.84e-05
#> [42,] 3.92e-06 4.87e-06 6.04e-06 7.47e-06 9.22e-06 1.14e-05 1.40e-05 1.72e-05
#> [43,] 6.78e-07 8.62e-07 1.09e-06 1.38e-06 1.74e-06 2.20e-06 2.76e-06 3.47e-06
#> [44,] 1.09e-07 1.42e-07 1.84e-07 2.38e-07 3.06e-07 3.94e-07 5.07e-07 6.50e-07
#> [45,] 1.64e-08 2.18e-08 2.88e-08 3.81e-08 5.02e-08 6.61e-08 8.68e-08 1.14e-07
#> [46,] 2.31e-09 3.13e-09 4.24e-09 5.73e-09 7.72e-09 1.04e-08 1.39e-08 1.87e-08
#> [47,] 3.06e-10 4.24e-10 5.87e-10 8.10e-10 1.12e-09 1.53e-09 2.11e-09 2.88e-09
#> [48,] 3.82e-11 5.42e-11 7.67e-11 1.08e-10 1.52e-10 2.14e-10 3.00e-10 4.21e-10
#> [49,] 4.53e-12 6.57e-12 9.50e-12 1.37e-11 1.97e-11 2.83e-11 4.06e-11 5.81e-11
#> [50,] 5.11e-13 7.56e-13 1.12e-12 1.65e-12 2.42e-12 3.56e-12 5.22e-12 7.63e-12
#> [51,] 5.48e-14 8.29e-14 1.25e-13 1.89e-13 2.84e-13 4.26e-13 6.38e-13 9.54e-13
#> [52,] 5.61e-15 8.68e-15 1.34e-14 2.06e-14 3.17e-14 4.87e-14 7.45e-14 1.14e-13
#> [53,] 5.49e-16 8.69e-16 1.37e-15 2.16e-15 3.39e-15 5.32e-15 8.32e-15 1.30e-14
#> [54,] 5.15e-17 8.33e-17 1.34e-16 2.16e-16 3.47e-16 5.57e-16 8.91e-16 1.42e-15
#> [,51] [,52] [,53] [,54]
#> [1,] 4.02e-10 8.15e-11 1.65e-11 3.34e-12
#> [2,] 4.02e-10 8.15e-11 1.65e-11 3.34e-12
#> [3,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [4,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [5,] 0.00e+00 0.00e+00 0.00e+00 0.00e+00
#> [6,] 7.78e-05 5.69e-05 4.16e-05 3.04e-05
#> [7,] 3.08e-03 2.48e-03 1.99e-03 1.60e-03
#> [8,] 4.13e-03 3.40e-03 2.79e-03 2.29e-03
#> [9,] 3.70e-03 3.11e-03 2.61e-03 2.18e-03
#> [10,] 2.48e-03 2.13e-03 1.83e-03 1.56e-03
#> [11,] 1.33e-03 1.17e-03 1.02e-03 8.97e-04
#> [12,] 5.96e-04 5.35e-04 4.79e-04 4.28e-04
#> [13,] 2.28e-04 2.10e-04 1.92e-04 1.75e-04
#> [14,] 7.66e-05 7.18e-05 6.72e-05 6.28e-05
#> [15,] 2.29e-05 2.19e-05 2.10e-05 2.00e-05
#> [16,] 6.13e-06 6.01e-06 5.87e-06 5.74e-06
#> [17,] 1.50e-06 1.50e-06 1.50e-06 1.49e-06
#> [18,] 3.35e-07 3.42e-07 3.50e-07 3.57e-07
#> [19,] 6.91e-08 7.23e-08 7.55e-08 7.87e-08
#> [20,] 1.32e-08 1.42e-08 1.51e-08 1.61e-08
#> [21,] 2.37e-09 2.59e-09 2.83e-09 3.08e-09
#> [22,] 3.97e-10 4.44e-10 4.95e-10 5.51e-10
#> [23,] 6.27e-11 7.16e-11 8.17e-11 9.30e-11
#> [24,] 9.36e-12 1.09e-11 1.27e-11 1.48e-11
#> [25,] 1.32e-12 1.58e-12 1.88e-12 2.23e-12
#> [26,] 1.77e-13 2.16e-13 2.63e-13 3.20e-13
#> [27,] 2.27e-14 2.82e-14 3.52e-14 4.37e-14
#> [28,] 2.76e-15 3.52e-15 4.48e-15 5.69e-15
#> [29,] 3.23e-16 4.20e-16 5.46e-16 7.09e-16
#> [30,] 3.61e-17 4.80e-17 6.38e-17 8.47e-17
#> [31,] 1.94e-01 1.86e-01 1.79e-01 1.71e-01
#> [32,] 2.60e-01 2.55e-01 2.51e-01 2.46e-01
#> [33,] 2.32e-01 2.34e-01 2.34e-01 2.35e-01
#> [34,] 1.56e-01 1.60e-01 1.64e-01 1.68e-01
#> [35,] 8.37e-02 8.79e-02 9.21e-02 9.64e-02
#> [36,] 3.74e-02 4.02e-02 4.30e-02 4.60e-02
#> [37,] 1.44e-02 1.57e-02 1.72e-02 1.88e-02
#> [38,] 4.82e-03 5.40e-03 6.04e-03 6.75e-03
#> [39,] 1.44e-03 1.65e-03 1.88e-03 2.15e-03
#> [40,] 3.85e-04 4.51e-04 5.28e-04 6.16e-04
#> [41,] 9.40e-05 1.13e-04 1.35e-04 1.61e-04
#> [42,] 2.10e-05 2.57e-05 3.14e-05 3.84e-05
#> [43,] 4.34e-06 5.43e-06 6.78e-06 8.46e-06
#> [44,] 8.32e-07 1.06e-06 1.36e-06 1.73e-06
#> [45,] 1.49e-07 1.95e-07 2.54e-07 3.31e-07
#> [46,] 2.50e-08 3.34e-08 4.45e-08 5.93e-08
#> [47,] 3.94e-09 5.38e-09 7.34e-09 9.99e-09
#> [48,] 5.88e-10 8.21e-10 1.14e-09 1.59e-09
#> [49,] 8.31e-11 1.18e-10 1.69e-10 2.40e-10
#> [50,] 1.11e-11 1.62e-11 2.37e-11 3.44e-11
#> [51,] 1.42e-12 2.12e-12 3.16e-12 4.69e-12
#> [52,] 1.74e-13 2.65e-13 4.03e-13 6.11e-13
#> [53,] 2.03e-14 3.16e-14 4.91e-14 7.62e-14
#> [54,] 2.27e-15 3.61e-15 5.73e-15 9.10e-15
Finally, let’s estimate the function-based historical MPM.
cypmatrix3fp <- flefko3(stageframe = cypframe_fb, supplement = cypsupp3_fb,
modelsuite = cypmodels3p, data = cypfb_v1, yearcol = "year2",
year.as.random = TRUE)
summary(cypmatrix3fp)
#>
#> This historical lefkoMat object contains 15 matrices.
#>
#> Each matrix is a square matrix with 2916 rows and columns, and a total of 8503056 elements.
#> A total of 1765635 survival transitions were estimated, with 117709 per matrix.
#> A total of 35280 fecundity transitions were estimated, with 2352 per matrix.
#>
#> Vital rate modeling quality control:
#>
#> Survival estimated with 74 individuals and 320 individual transitions.
#> Observation estimated with 70 individuals and 303 individual transitions.
#> Size estimated with 70 individuals and 288 individual transitions.
#> Reproductive status estimated with 70 individuals and 288 individual transitions.
#> Fecundity estimated with 51 individuals and 118 individual transitions.
#> Juvenile survival not estimated.
#> Juvenile observation probability not estimated.
#> Juvenile size transition not estimated.
#> Juvenile reproduction probability not estimated.
#>
#> Survival probability sum check (each matrix represented by column in order):
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12]
#> Min. 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
#> 1st Qu. 0.965 0.965 0.965 0.965 0.965 0.965 0.965 0.965 0.965 0.965 0.965 0.965
#> Median 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
#> Mean 0.819 0.819 0.819 0.819 0.819 0.819 0.819 0.819 0.819 0.819 0.819 0.819
#> 3rd Qu. 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
#> Max. 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
#> [,13] [,14] [,15]
#> Min. 0.000 0.000 0.000
#> 1st Qu. 0.965 0.965 0.965
#> Median 1.000 1.000 1.000
#> Mean 0.819 0.819 0.819
#> 3rd Qu. 1.000 1.000 1.000
#> Max. 1.000 1.000 1.000
#> NULL
Let’s note the contrasts with the other MPMs in the output above. First, we see 15 matrices produced again. However, in the raw hMPM, we only saw 12 matrices, because of the fact that we need 3 monitoring occasions of data to parameterize each raw transition (6 monitoring occasions total means 4 sets of 3 monitoring occasions, or 4 total time steps, in the historical case). Since this is a function-based MPM, and since it resulted from a mixed modeling strategy where year was treated as random, we can actually use our functions to estimate transitions in the first year even without a full set of 3 years of data. The result is 5 time steps that we can estimate transitions for.
Second, these matrices are utterly huge. They have \(54^2 = 2916\) rows and columns, yielding \(2916^2 = 8503056\) total elements per matrix. Our raw hMPM had \(11^2 = 121\) rows and columns, yielding 14,641 elements per matrix. Finally, although the raw hMPMs only had an average of 37.83 elements estimated per matrix, here we have 120,061 elements estimated per matrix. This is vastly more. However, it is also just a small fraction of the total number of elements in the matrix. In fact, in an unreduced hMPM estimated in Ehrlén format, the total number of elements that can be estimated is equal to \(\frac{r \times c}{m}\), where \(r\) and \(c\) are the numbers of rows and columns, respectively, and \(m\) is the number of stages in the stageframe. For example, if there are 10 stages in the stageframe, then only 1000 of the total 10,000 elements in the hMPM are estimable (10% of the elements).
Now that we have created our MPMs, we might wish to create element-wise arithmetic mean matrices to aid inference and further analysis. For example, we might be interested in developing patch-level means and an overall population mean, but one in which the element means treat each patch and each year as equal in proportional effect. For this purpose, we can use the lmean() function. Let’s take a look at the mean raw ahMPM first.
cyp2rp_mean <- lmean(cypmatrix2rp)
cyp2rp_mean
#> $A
#> $A[[1]]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#> [1,] 0.03 0.0 0.0 0.0 0.00000000 0.00000000 62.50000000 422.22222222
#> [2,] 0.15 0.0 0.0 0.0 0.00000000 0.00000000 62.50000000 422.22222222
#> [3,] 0.00 0.1 0.0 0.0 0.00000000 0.00000000 0.00000000 0.00000000
#> [4,] 0.00 0.0 0.1 0.0 0.00000000 0.00000000 0.00000000 0.00000000
#> [5,] 0.00 0.0 0.0 0.1 0.05000000 0.00000000 0.00000000 0.00000000
#> [6,] 0.00 0.0 0.0 0.0 0.05833333 0.00000000 0.05833333 0.04444444
#> [7,] 0.00 0.0 0.0 0.0 0.59949495 0.06666667 0.59949495 0.19555556
#> [8,] 0.00 0.0 0.0 0.0 0.00000000 0.33333333 0.21010101 0.59555556
#> [9,] 0.00 0.0 0.0 0.0 0.00000000 0.00000000 0.00000000 0.08444444
#> [10,] 0.00 0.0 0.0 0.0 0.00000000 0.00000000 0.00000000 0.00000000
#> [11,] 0.00 0.0 0.0 0.0 0.00000000 0.00000000 0.00000000 0.00000000
#> [,9] [,10] [,11]
#> [1,] 1.583333e+03 0.0 0
#> [2,] 1.583333e+03 0.0 0
#> [3,] 0.000000e+00 0.0 0
#> [4,] 0.000000e+00 0.0 0
#> [5,] 0.000000e+00 0.0 0
#> [6,] 0.000000e+00 0.0 0
#> [7,] 6.666667e-02 0.0 0
#> [8,] 2.500000e-01 0.2 0
#> [9,] 4.833333e-01 0.0 0
#> [10,] 2.000000e-01 0.0 0
#> [11,] 0.000000e+00 0.0 0
#>
#> $A[[2]]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#> [1,] 0.03 0.0 0.0 0.0 0.00000000 0.00000000 55.55555556 572.91666667
#> [2,] 0.15 0.0 0.0 0.0 0.00000000 0.00000000 55.55555556 572.91666667
#> [3,] 0.00 0.1 0.0 0.0 0.00000000 0.00000000 0.00000000 0.00000000
#> [4,] 0.00 0.0 0.1 0.0 0.00000000 0.00000000 0.00000000 0.00000000
#> [5,] 0.00 0.0 0.0 0.1 0.05000000 0.00000000 0.00000000 0.00000000
#> [6,] 0.00 0.0 0.0 0.0 0.07676768 0.06666667 0.07676768 0.05416667
#> [7,] 0.00 0.0 0.0 0.0 0.45974026 0.46666667 0.45974026 0.23083333
#> [8,] 0.00 0.0 0.0 0.0 0.00000000 0.20000000 0.30966811 0.50166667
#> [9,] 0.00 0.0 0.0 0.0 0.00000000 0.00000000 0.02222222 0.14416667
#> [10,] 0.00 0.0 0.0 0.0 0.00000000 0.06666667 0.02222222 0.01250000
#> [11,] 0.00 0.0 0.0 0.0 0.00000000 0.00000000 0.00000000 0.00000000
#> [,9] [,10] [,11]
#> [1,] 2392.8571429 2875.0 6e+03
#> [2,] 2392.8571429 2875.0 6e+03
#> [3,] 0.0000000 0.0 0e+00
#> [4,] 0.0000000 0.0 0e+00
#> [5,] 0.0000000 0.0 0e+00
#> [6,] 0.0000000 0.0 0e+00
#> [7,] 0.0500000 0.0 0e+00
#> [8,] 0.4000000 0.1 0e+00
#> [9,] 0.3428571 0.2 0e+00
#> [10,] 0.2071429 0.6 2e-01
#> [11,] 0.0000000 0.1 4e-01
#>
#> $A[[3]]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
#> [1,] 0.03 0.0 0.0 0.0 0.00000000 0.0 0.00000000 422.61904762 1625.0000000
#> [2,] 0.15 0.0 0.0 0.0 0.00000000 0.0 0.00000000 422.61904762 1625.0000000
#> [3,] 0.00 0.1 0.0 0.0 0.00000000 0.0 0.00000000 0.00000000 0.0000000
#> [4,] 0.00 0.0 0.1 0.0 0.00000000 0.0 0.00000000 0.00000000 0.0000000
#> [5,] 0.00 0.0 0.0 0.1 0.05000000 0.0 0.00000000 0.00000000 0.0000000
#> [6,] 0.00 0.0 0.0 0.0 0.06666667 0.0 0.06666667 0.03333333 0.0000000
#> [7,] 0.00 0.0 0.0 0.0 0.50000000 0.1 0.50000000 0.11666667 0.1333333
#> [8,] 0.00 0.0 0.0 0.0 0.00000000 0.1 0.26666667 0.54761905 0.3333333
#> [9,] 0.00 0.0 0.0 0.0 0.00000000 0.0 0.06666667 0.22380952 0.5333333
#> [10,] 0.00 0.0 0.0 0.0 0.00000000 0.0 0.00000000 0.07857143 0.0000000
#> [11,] 0.00 0.0 0.0 0.0 0.00000000 0.0 0.00000000 0.00000000 0.0000000
#> [,10] [,11]
#> [1,] 750.0 2500.0
#> [2,] 750.0 2500.0
#> [3,] 0.0 0.0
#> [4,] 0.0 0.0
#> [5,] 0.0 0.0
#> [6,] 0.0 0.0
#> [7,] 0.0 0.0
#> [8,] 0.1 0.0
#> [9,] 0.2 0.0
#> [10,] 0.4 0.2
#> [11,] 0.1 0.4
#>
#> $A[[4]]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#> [1,] 0.03 0.0 0.0 0.0 0.00000000 0.00000000 39.351851852 472.58597884
#> [2,] 0.15 0.0 0.0 0.0 0.00000000 0.00000000 39.351851852 472.58597884
#> [3,] 0.00 0.1 0.0 0.0 0.00000000 0.00000000 0.000000000 0.00000000
#> [4,] 0.00 0.0 0.1 0.0 0.00000000 0.00000000 0.000000000 0.00000000
#> [5,] 0.00 0.0 0.0 0.1 0.05000000 0.00000000 0.000000000 0.00000000
#> [6,] 0.00 0.0 0.0 0.0 0.06725589 0.02222222 0.067255892 0.04398148
#> [7,] 0.00 0.0 0.0 0.0 0.51974507 0.21111111 0.519745070 0.18101852
#> [8,] 0.00 0.0 0.0 0.0 0.00000000 0.21111111 0.262145262 0.54828042
#> [9,] 0.00 0.0 0.0 0.0 0.00000000 0.00000000 0.029629630 0.15080688
#> [10,] 0.00 0.0 0.0 0.0 0.00000000 0.02222222 0.007407407 0.03035714
#> [11,] 0.00 0.0 0.0 0.0 0.00000000 0.00000000 0.000000000 0.00000000
#> [,9] [,10] [,11]
#> [1,] 1.867063e+03 1.208333e+03 2833.3333333
#> [2,] 1.867063e+03 1.208333e+03 2833.3333333
#> [3,] 0.000000e+00 0.000000e+00 0.0000000
#> [4,] 0.000000e+00 0.000000e+00 0.0000000
#> [5,] 0.000000e+00 0.000000e+00 0.0000000
#> [6,] 0.000000e+00 0.000000e+00 0.0000000
#> [7,] 8.333333e-02 0.000000e+00 0.0000000
#> [8,] 3.277778e-01 1.333333e-01 0.0000000
#> [9,] 4.531746e-01 1.333333e-01 0.0000000
#> [10,] 1.357143e-01 3.333333e-01 0.1333333
#> [11,] 0.000000e+00 6.666667e-02 0.2666667
#>
#>
#> $U
#> $U[[1]]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#> [1,] 0.03 0.0 0.0 0.0 0.00000000 0.00000000 0.00000000 0.00000000
#> [2,] 0.15 0.0 0.0 0.0 0.00000000 0.00000000 0.00000000 0.00000000
#> [3,] 0.00 0.1 0.0 0.0 0.00000000 0.00000000 0.00000000 0.00000000
#> [4,] 0.00 0.0 0.1 0.0 0.00000000 0.00000000 0.00000000 0.00000000
#> [5,] 0.00 0.0 0.0 0.1 0.05000000 0.00000000 0.00000000 0.00000000
#> [6,] 0.00 0.0 0.0 0.0 0.05833333 0.00000000 0.05833333 0.04444444
#> [7,] 0.00 0.0 0.0 0.0 0.59949495 0.06666667 0.59949495 0.19555556
#> [8,] 0.00 0.0 0.0 0.0 0.00000000 0.33333333 0.21010101 0.59555556
#> [9,] 0.00 0.0 0.0 0.0 0.00000000 0.00000000 0.00000000 0.08444444
#> [10,] 0.00 0.0 0.0 0.0 0.00000000 0.00000000 0.00000000 0.00000000
#> [11,] 0.00 0.0 0.0 0.0 0.00000000 0.00000000 0.00000000 0.00000000
#> [,9] [,10] [,11]
#> [1,] 0.00000000 0.0 0
#> [2,] 0.00000000 0.0 0
#> [3,] 0.00000000 0.0 0
#> [4,] 0.00000000 0.0 0
#> [5,] 0.00000000 0.0 0
#> [6,] 0.00000000 0.0 0
#> [7,] 0.06666667 0.0 0
#> [8,] 0.25000000 0.2 0
#> [9,] 0.48333333 0.0 0
#> [10,] 0.20000000 0.0 0
#> [11,] 0.00000000 0.0 0
#>
#> $U[[2]]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
#> [1,] 0.03 0.0 0.0 0.0 0.00000000 0.00000000 0.00000000 0.00000000 0.0000000
#> [2,] 0.15 0.0 0.0 0.0 0.00000000 0.00000000 0.00000000 0.00000000 0.0000000
#> [3,] 0.00 0.1 0.0 0.0 0.00000000 0.00000000 0.00000000 0.00000000 0.0000000
#> [4,] 0.00 0.0 0.1 0.0 0.00000000 0.00000000 0.00000000 0.00000000 0.0000000
#> [5,] 0.00 0.0 0.0 0.1 0.05000000 0.00000000 0.00000000 0.00000000 0.0000000
#> [6,] 0.00 0.0 0.0 0.0 0.07676768 0.06666667 0.07676768 0.05416667 0.0000000
#> [7,] 0.00 0.0 0.0 0.0 0.45974026 0.46666667 0.45974026 0.23083333 0.0500000
#> [8,] 0.00 0.0 0.0 0.0 0.00000000 0.20000000 0.30966811 0.50166667 0.4000000
#> [9,] 0.00 0.0 0.0 0.0 0.00000000 0.00000000 0.02222222 0.14416667 0.3428571
#> [10,] 0.00 0.0 0.0 0.0 0.00000000 0.06666667 0.02222222 0.01250000 0.2071429
#> [11,] 0.00 0.0 0.0 0.0 0.00000000 0.00000000 0.00000000 0.00000000 0.0000000
#> [,10] [,11]
#> [1,] 0.0 0.0
#> [2,] 0.0 0.0
#> [3,] 0.0 0.0
#> [4,] 0.0 0.0
#> [5,] 0.0 0.0
#> [6,] 0.0 0.0
#> [7,] 0.0 0.0
#> [8,] 0.1 0.0
#> [9,] 0.2 0.0
#> [10,] 0.6 0.2
#> [11,] 0.1 0.4
#>
#> $U[[3]]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> [1,] 0.03 0.0 0.0 0.0 0.00000000 0.0 0.00000000 0.00000000 0.0000000 0.0
#> [2,] 0.15 0.0 0.0 0.0 0.00000000 0.0 0.00000000 0.00000000 0.0000000 0.0
#> [3,] 0.00 0.1 0.0 0.0 0.00000000 0.0 0.00000000 0.00000000 0.0000000 0.0
#> [4,] 0.00 0.0 0.1 0.0 0.00000000 0.0 0.00000000 0.00000000 0.0000000 0.0
#> [5,] 0.00 0.0 0.0 0.1 0.05000000 0.0 0.00000000 0.00000000 0.0000000 0.0
#> [6,] 0.00 0.0 0.0 0.0 0.06666667 0.0 0.06666667 0.03333333 0.0000000 0.0
#> [7,] 0.00 0.0 0.0 0.0 0.50000000 0.1 0.50000000 0.11666667 0.1333333 0.0
#> [8,] 0.00 0.0 0.0 0.0 0.00000000 0.1 0.26666667 0.54761905 0.3333333 0.1
#> [9,] 0.00 0.0 0.0 0.0 0.00000000 0.0 0.06666667 0.22380952 0.5333333 0.2
#> [10,] 0.00 0.0 0.0 0.0 0.00000000 0.0 0.00000000 0.07857143 0.0000000 0.4
#> [11,] 0.00 0.0 0.0 0.0 0.00000000 0.0 0.00000000 0.00000000 0.0000000 0.1
#> [,11]
#> [1,] 0.0
#> [2,] 0.0
#> [3,] 0.0
#> [4,] 0.0
#> [5,] 0.0
#> [6,] 0.0
#> [7,] 0.0
#> [8,] 0.0
#> [9,] 0.0
#> [10,] 0.2
#> [11,] 0.4
#>
#> $U[[4]]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#> [1,] 0.03 0.0 0.0 0.0 0.00000000 0.00000000 0.000000000 0.00000000
#> [2,] 0.15 0.0 0.0 0.0 0.00000000 0.00000000 0.000000000 0.00000000
#> [3,] 0.00 0.1 0.0 0.0 0.00000000 0.00000000 0.000000000 0.00000000
#> [4,] 0.00 0.0 0.1 0.0 0.00000000 0.00000000 0.000000000 0.00000000
#> [5,] 0.00 0.0 0.0 0.1 0.05000000 0.00000000 0.000000000 0.00000000
#> [6,] 0.00 0.0 0.0 0.0 0.06725589 0.02222222 0.067255892 0.04398148
#> [7,] 0.00 0.0 0.0 0.0 0.51974507 0.21111111 0.519745070 0.18101852
#> [8,] 0.00 0.0 0.0 0.0 0.00000000 0.21111111 0.262145262 0.54828042
#> [9,] 0.00 0.0 0.0 0.0 0.00000000 0.00000000 0.029629630 0.15080688
#> [10,] 0.00 0.0 0.0 0.0 0.00000000 0.02222222 0.007407407 0.03035714
#> [11,] 0.00 0.0 0.0 0.0 0.00000000 0.00000000 0.000000000 0.00000000
#> [,9] [,10] [,11]
#> [1,] 0.00000000 0.00000000 0.0000000
#> [2,] 0.00000000 0.00000000 0.0000000
#> [3,] 0.00000000 0.00000000 0.0000000
#> [4,] 0.00000000 0.00000000 0.0000000
#> [5,] 0.00000000 0.00000000 0.0000000
#> [6,] 0.00000000 0.00000000 0.0000000
#> [7,] 0.08333333 0.00000000 0.0000000
#> [8,] 0.32777778 0.13333333 0.0000000
#> [9,] 0.45317460 0.13333333 0.0000000
#> [10,] 0.13571429 0.33333333 0.1333333
#> [11,] 0.00000000 0.06666667 0.2666667
#>
#>
#> $F
#> $F[[1]]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0 0 0 0 0 0 62.5 422.2222 1583.333 0 0
#> [2,] 0 0 0 0 0 0 62.5 422.2222 1583.333 0 0
#> [3,] 0 0 0 0 0 0 0.0 0.0000 0.000 0 0
#> [4,] 0 0 0 0 0 0 0.0 0.0000 0.000 0 0
#> [5,] 0 0 0 0 0 0 0.0 0.0000 0.000 0 0
#> [6,] 0 0 0 0 0 0 0.0 0.0000 0.000 0 0
#> [7,] 0 0 0 0 0 0 0.0 0.0000 0.000 0 0
#> [8,] 0 0 0 0 0 0 0.0 0.0000 0.000 0 0
#> [9,] 0 0 0 0 0 0 0.0 0.0000 0.000 0 0
#> [10,] 0 0 0 0 0 0 0.0 0.0000 0.000 0 0
#> [11,] 0 0 0 0 0 0 0.0 0.0000 0.000 0 0
#>
#> $F[[2]]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0 0 0 0 0 0 55.55556 572.9167 2392.857 2875 6000
#> [2,] 0 0 0 0 0 0 55.55556 572.9167 2392.857 2875 6000
#> [3,] 0 0 0 0 0 0 0.00000 0.0000 0.000 0 0
#> [4,] 0 0 0 0 0 0 0.00000 0.0000 0.000 0 0
#> [5,] 0 0 0 0 0 0 0.00000 0.0000 0.000 0 0
#> [6,] 0 0 0 0 0 0 0.00000 0.0000 0.000 0 0
#> [7,] 0 0 0 0 0 0 0.00000 0.0000 0.000 0 0
#> [8,] 0 0 0 0 0 0 0.00000 0.0000 0.000 0 0
#> [9,] 0 0 0 0 0 0 0.00000 0.0000 0.000 0 0
#> [10,] 0 0 0 0 0 0 0.00000 0.0000 0.000 0 0
#> [11,] 0 0 0 0 0 0 0.00000 0.0000 0.000 0 0
#>
#> $F[[3]]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0 0 0 0 0 0 0 422.619 1625 750 2500
#> [2,] 0 0 0 0 0 0 0 422.619 1625 750 2500
#> [3,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [4,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [5,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [6,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [7,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [8,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [9,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [10,] 0 0 0 0 0 0 0 0.000 0 0 0
#> [11,] 0 0 0 0 0 0 0 0.000 0 0 0
#>
#> $F[[4]]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
#> [1,] 0 0 0 0 0 0 39.35185 472.586 1867.063 1208.333 2833.333
#> [2,] 0 0 0 0 0 0 39.35185 472.586 1867.063 1208.333 2833.333
#> [3,] 0 0 0 0 0 0 0.00000 0.000 0.000 0.000 0.000
#> [4,] 0 0 0 0 0 0 0.00000 0.000 0.000 0.000 0.000
#> [5,] 0 0 0 0 0 0 0.00000 0.000 0.000 0.000 0.000
#> [6,] 0 0 0 0 0 0 0.00000 0.000 0.000 0.000 0.000
#> [7,] 0 0 0 0 0 0 0.00000 0.000 0.000 0.000 0.000
#> [8,] 0 0 0 0 0 0 0.00000 0.000 0.000 0.000 0.000
#> [9,] 0 0 0 0 0 0 0.00000 0.000 0.000 0.000 0.000
#> [10,] 0 0 0 0 0 0 0.00000 0.000 0.000 0.000 0.000
#> [11,] 0 0 0 0 0 0 0.00000 0.000 0.000 0.000 0.000
#>
#>
#> $hstages
#> [1] NA
#>
#> $agestages
#> NA
#> 1 NA
#>
#> $ahstages
#> stage_id stage original_size bin_size_ctr bin_size_min bin_size_max
#> 1 1 SD 0.0 0.0 0.0 0.0
#> 2 2 P1 0.0 0.0 0.0 0.0
#> 3 3 P2 0.0 0.0 0.0 0.0
#> 4 4 P3 0.0 0.0 0.0 0.0
#> 5 5 SL 0.0 0.0 0.0 0.0
#> 6 6 D 0.0 0.0 -0.5 0.5
#> 7 7 XSm 1.0 1.0 0.5 1.5
#> 8 8 Sm 3.0 3.0 1.5 4.5
#> 9 9 Md 6.0 6.0 4.5 7.5
#> 10 10 Lg 11.0 11.0 7.5 14.5
#> 11 11 XLg 19.5 19.5 14.5 24.5
#> repstatus obsstatus propstatus immstatus matstatus entrystage indataset
#> 1 0 0 1 0 0 1 0
#> 2 0 0 0 1 0 1 0
#> 3 0 0 0 1 0 0 0
#> 4 0 0 0 1 0 0 0
#> 5 0 0 0 1 0 0 0
#> 6 0 0 0 0 1 0 1
#> 7 1 1 0 0 1 0 1
#> 8 1 1 0 0 1 0 1
#> 9 1 1 0 0 1 0 1
#> 10 1 1 0 0 1 0 1
#> 11 1 1 0 0 1 0 1
#> bin_size_width bin_raw_halfwidth alive min_age max_age
#> 1 0 0.0 1 NA NA
#> 2 0 0.0 1 NA NA
#> 3 0 0.0 1 NA NA
#> 4 0 0.0 1 NA NA
#> 5 0 0.0 1 NA NA
#> 6 1 0.5 1 NA NA
#> 7 1 0.5 1 NA NA
#> 8 3 1.5 1 NA NA
#> 9 3 1.5 1 NA NA
#> 10 7 3.5 1 NA NA
#> 11 10 5.0 1 NA NA
#> comments stageno
#> 1 Dormant seed 1
#> 2 1st yr protocorm 2
#> 3 2nd yr protocorm 3
#> 4 3rd yr protocorm 4
#> 5 Seedling 5
#> 6 Dormant adult 6
#> 7 Extra small adult (1 shoot) 7
#> 8 Small adult (2-4 shoots) 8
#> 9 Medium adult (5-7 shoots) 9
#> 10 Large adult (8-14 shoots) 10
#> 11 Extra large adult (>14 shoots) 11
#>
#> $labels
#> pop patch
#> 1 1 A
#> 2 1 B
#> 3 1 C
#> 4 1 0
#>
#> $matrixqc
#> [,1]
#> [1,] 114
#> [2,] 34
#> [3,] 4
#>
#> attr(,"class")
#> [1] "lefkoMat"
A quick scan through our output shows that we have 4 matrices. The labels element shows us the order of these. There is no time term in the labels element, because all matrices are temporal means. Instead, we see that the first 3 matrices are the patch-level means for patches A, B, and C. This is followed by the overall population mean matrix, listed as patch 0. It also pays to look at the summary.
summary(cyp2rp_mean)
#>
#> This ahistorical lefkoMat object contains 4 matrices.
#>
#> Each matrix is a square matrix with 11 rows and columns, and a total of 121 elements.
#> A total of 114 survival transitions were estimated, with 28.5 per matrix.
#> A total of 34 fecundity transitions were estimated, with 8.5 per matrix.
#>
#> Survival probability sum check (each matrix represented by column in order):
#> [,1] [,2] [,3] [,4]
#> Min. 0.000 0.100 0.100 0.100
#> 1st Qu. 0.100 0.140 0.140 0.140
#> Median 0.200 0.600 0.600 0.467
#> Mean 0.416 0.573 0.509 0.499
#> 3rd Qu. 0.788 0.917 0.850 0.776
#> Max. 1.000 1.000 1.000 1.000
#> NULL
And so we see that we have 4 matrices, and we see that these matrices have slightly more elements estimated, on average, than in the raw ahistorical MPM. This happened because some of the 0s in the original raw MPM were 0s only because of a sampling issue - no individuals actually transitioned through a particular transition in a particular year, but may have transitioned in other years, yielding higher numbers of non-zero elements in the arithmetic mean matrices than in the original raw matrices. Unfortunately these 0s will nonetheless drag these mean element values down artificially, potentially impacting our analyses. A comparison with the function-based means should be interesting in this regard.
cyp2fp_mean <- lmean(cypmatrix2fp)
summary(cyp2fp_mean)
#>
#> This ahistorical lefkoMat object contains 4 matrices.
#>
#> Each matrix is a square matrix with 54 rows and columns, and a total of 2916 elements.
#> A total of 9640 survival transitions were estimated, with 2410 per matrix.
#> A total of 192 fecundity transitions were estimated, with 48 per matrix.
#>
#> Survival probability sum check (each matrix represented by column in order):
#> [,1] [,2] [,3] [,4]
#> Min. 0.100 0.100 0.100 0.100
#> 1st Qu. 0.991 0.991 0.991 0.991
#> Median 1.000 1.000 1.000 1.000
#> Mean 0.920 0.920 0.918 0.919
#> 3rd Qu. 1.000 1.000 1.000 1.000
#> Max. 1.000 1.000 1.000 1.000
#> NULL
The function-based mean matrices have the same number of estimated transitions as their constituent matrices, because all elements that are estimable are actually estimated using the vital rate models supplied.
Now let’s create the final sets of arithmetic mean matrices for the hMPMs.
cyp3rp_mean <- lmean(cypmatrix3rp)
cyp3fp_mean <- lmean(cypmatrix3fp)
summary(cyp3rp_mean)
#>
#> This historical lefkoMat object contains 4 matrices.
#>
#> Each matrix is a square matrix with 121 rows and columns, and a total of 14641 elements.
#> A total of 242 survival transitions were estimated, with 60.5 per matrix.
#> A total of 74 fecundity transitions were estimated, with 18.5 per matrix.
#>
#> Survival probability sum check (each matrix represented by column in order):
#> [,1] [,2] [,3] [,4]
#> Min. 0.0000 0.000 0.0000 0.0000
#> 1st Qu. 0.0000 0.000 0.0000 0.0000
#> Median 0.0000 0.000 0.0000 0.0000
#> Mean 0.0747 0.128 0.0947 0.0991
#> 3rd Qu. 0.0000 0.250 0.0000 0.1000
#> Max. 1.0000 1.000 1.0000 0.9907
#> NULL
summary(cyp3fp_mean)
#>
#> This historical lefkoMat object contains 4 matrices.
#>
#> Each matrix is a square matrix with 2916 rows and columns, and a total of 8503056 elements.
#> A total of 470836 survival transitions were estimated, with 117709 per matrix.
#> A total of 9408 fecundity transitions were estimated, with 2352 per matrix.
#>
#> Survival probability sum check (each matrix represented by column in order):
#> [,1] [,2] [,3] [,4]
#> Min. 0.000 0.000 0.000 0.000
#> 1st Qu. 0.965 0.965 0.965 0.965
#> Median 1.000 1.000 1.000 1.000
#> Mean 0.819 0.819 0.819 0.819
#> 3rd Qu. 1.000 1.000 1.000 1.000
#> Max. 1.000 1.000 1.000 1.000
#> NULL
Finaly, let’s create the remaining population-level MPMs that have not been created.
cypmatrix3r <- rlefko3(data = cypraw_v1, stageframe = cypframe_raw,
year = "all", stages = c("stage3", "stage2", "stage1"),
size = c("size3added", "size2added", "size1added"), supplement = cypsupp3_raw,
yearcol = "year2", patchcol = "patchid", indivcol = "individ")
cypmatrix3f <- flefko3(stageframe = cypframe_fb, supplement = cypsupp3_fb,
modelsuite = cypmodels3, data = cypfb_v1, yearcol = "year2",
year.as.random = TRUE)
cypmatrix2f <- flefko2(stageframe = cypframe_fb, supplement = cypsupp2_fb,
modelsuite = cypmodels2, data = cypfb_v1, patch.as.random = TRUE,
year.as.random = TRUE)
cyp3r_mean <- lmean(cypmatrix3r)
cyp3f_mean <- lmean(cypmatrix3f)
cyp2r_mean <- lmean(cypmatrix2r)
cyp2f_mean <- lmean(cypmatrix2f)
In this section, we wish to look at 4 issues that have arisen in MPM building so far - the use of supplement tables vs. overwrite tables and reproductive matrices, the importance of proper parameterization of size and fecundity, matrix dimensionality reduction, and Ehrlén format vs. deVries format. We will also consider a fifth issue - vital rate model accuracy. Let’s start with the first issue - supplement tables vs. overwrite tables and reproductive matrices.
All of the MPMs that we have built so far have utilized supplement tables to provide our matrix building functions with the extra information not supplied in the demographic dataset itself to properly parameterize MPMs. The supplement table is a very powerful of achieving this aim. However, the first publicly available versions of lefko3 utilized a different approach based on some existing methods used in other packages - the overwrite table combined with a reproductive matrix. We do not advocate their use, mostly because properly parameterizing fecundity in particular is more difficult with this approach, but all matrix building functions retain the ability to utilize this method. Here we show a call to create a new, function-based ahMPM using the previously developed overwrite table and reproductive matrix instead of the correct supplemental table. We then compare the summaries.
cypmatrix2f_overwrite <- flefko2(stageframe = cypframe_fb,
overwrite = cypover2_fb, repmatrix = rep.assumptions_fb,
modelsuite = cypmodels2, data = cypfb_v1, patch.as.random = TRUE,
year.as.random = TRUE)
summary(cypmatrix2f_overwrite)
#>
#> This ahistorical lefkoMat object contains 5 matrices.
#>
#> Each matrix is a square matrix with 54 rows and columns, and a total of 2916 elements.
#> A total of 12050 survival transitions were estimated, with 2410 per matrix.
#> A total of 240 fecundity transitions were estimated, with 48 per matrix.
#>
#> Vital rate modeling quality control:
#>
#> Survival estimated with 74 individuals and 320 individual transitions.
#> Observation estimated with 70 individuals and 303 individual transitions.
#> Size estimated with 70 individuals and 288 individual transitions.
#> Reproductive status estimated with 70 individuals and 288 individual transitions.
#> Fecundity estimated with 51 individuals and 118 individual transitions.
#> Juvenile survival not estimated.
#> Juvenile observation probability not estimated.
#> Juvenile size transition not estimated.
#> Juvenile reproduction probability not estimated.
#>
#> Survival probability sum check (each matrix represented by column in order):
#> [,1] [,2] [,3] [,4] [,5]
#> Min. 0.100 0.100 0.100 0.100 0.100
#> 1st Qu. 0.991 0.991 0.991 0.991 0.991
#> Median 1.000 1.000 1.000 1.000 1.000
#> Mean 0.918 0.921 0.920 0.920 0.917
#> 3rd Qu. 1.000 1.000 1.000 1.000 1.000
#> Max. 1.000 1.000 1.000 1.000 1.000
#> NULL
summary(cypmatrix2f)
#>
#> This ahistorical lefkoMat object contains 5 matrices.
#>
#> Each matrix is a square matrix with 54 rows and columns, and a total of 2916 elements.
#> A total of 12050 survival transitions were estimated, with 2410 per matrix.
#> A total of 240 fecundity transitions were estimated, with 48 per matrix.
#>
#> Vital rate modeling quality control:
#>
#> Survival estimated with 74 individuals and 320 individual transitions.
#> Observation estimated with 70 individuals and 303 individual transitions.
#> Size estimated with 70 individuals and 288 individual transitions.
#> Reproductive status estimated with 70 individuals and 288 individual transitions.
#> Fecundity estimated with 51 individuals and 118 individual transitions.
#> Juvenile survival not estimated.
#> Juvenile observation probability not estimated.
#> Juvenile size transition not estimated.
#> Juvenile reproduction probability not estimated.
#>
#> Survival probability sum check (each matrix represented by column in order):
#> [,1] [,2] [,3] [,4] [,5]
#> Min. 0.100 0.100 0.100 0.100 0.100
#> 1st Qu. 0.991 0.991 0.991 0.991 0.991
#> Median 1.000 1.000 1.000 1.000 1.000
#> Mean 0.918 0.921 0.920 0.920 0.917
#> 3rd Qu. 1.000 1.000 1.000 1.000 1.000
#> Max. 1.000 1.000 1.000 1.000 1.000
#> NULL
The summaries show exactly the same output, and if we went through each matrix with a fine-toothed comb, we would find no difference. However, it is possible to see differences in hMPMs, because of the difficulty in properly framing the reproductive matrix for the historical case. Please use the supplemental table approach to limit errors.
The second issue is the proper parameterization of size and fecundity in the function-based approach. In this example, we used the sf_distrib() function to assess the distributions to use, since we knew that both size and fecundity are count variables. That assessment led to the choice of the zero-truncated negative binomial distribution to model size, and the zero-inflated Poisson distribution to model fecundity. The impact of the choices we made for these distributions can be quite profound, and can strongly impact the results of analysis. To allow us to make comparisons later, let’s create two more sets of vital rate models and one more function-based ahMPM utilizing the Poisson distribution for both size and fecundity. Note that this choice may have a large effect because the Poisson distribution assumes that the mean and variance are equal (the negative binomial only assumes that they are related), and actually predicts specific numbers of 0s (zero truncation and zero inflation make this far more flexible).
cypmodels2_wrong <- modelsearch(cypfb_v1, historical = FALSE, approach = "mixed",
vitalrates = c("surv", "obs", "size", "repst", "fec"),
sizedist = "poisson", fecdist = "poisson", suite = "full",
size = c("size3added", "size2added", "size1added"), quiet = TRUE)
#> Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
#> Model failed to converge with max|grad| = 0.0330464 (tol = 0.002, component 1)
cypmodels2p_wrong <- modelsearch(cypfb_v1, historical = FALSE, approach = "mixed",
vitalrates = c("surv", "obs", "size", "repst", "fec"), patch = "patchid",
sizedist = "poisson", fecdist = "poisson", suite = "full",
size = c("size3added", "size2added", "size1added"), quiet = TRUE)
#> Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
#> Model failed to converge with max|grad| = 0.0106413 (tol = 0.002, component 1)
#> boundary (singular) fit: see ?isSingular
cypmodels3_wrong <- modelsearch(cypfb_v1, historical = TRUE, approach = "mixed",
vitalrates = c("surv", "obs", "size", "repst", "fec"),
sizedist = "poisson", fecdist = "poisson", suite = "full",
size = c("size3added", "size2added", "size1added"), quiet = TRUE)
#> boundary (singular) fit: see ?isSingular
#> Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
#> Model failed to converge with max|grad| = 0.00275551 (tol = 0.002, component 1)
#> Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
#> Model failed to converge with max|grad| = 0.016453 (tol = 0.002, component 1)
#> Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model is nearly unidentifiable: very large eigenvalue
#> - Rescale variables?
#> Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
#> Model failed to converge with max|grad| = 0.0099624 (tol = 0.002, component 1)
#> Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model is nearly unidentifiable: very large eigenvalue
#> - Rescale variables?
cypmatrix2f_wrong <- flefko2(stageframe = cypframe_fb, supplement = cypsupp2_fb,
modelsuite = cypmodels2_wrong, data = cypfb_v1, patch.as.random = TRUE,
year.as.random = TRUE)
cypmatrix2fp_wrong <- flefko2(stageframe = cypframe_fb, supplement = cypsupp2_fb,
modelsuite = cypmodels2p_wrong, data = cypfb_v1, patch.as.random = TRUE,
year.as.random = TRUE)
cypmatrix3f_wrong <- flefko3(stageframe = cypframe_fb, supplement = cypsupp3_fb,
modelsuite = cypmodels3_wrong, data = cypfb_v1, yearcol = "year2",
year.as.random = TRUE)
summary(cypmatrix2f_wrong)
#>
#> This ahistorical lefkoMat object contains 5 matrices.
#>
#> Each matrix is a square matrix with 54 rows and columns, and a total of 2916 elements.
#> A total of 12050 survival transitions were estimated, with 2410 per matrix.
#> A total of 240 fecundity transitions were estimated, with 48 per matrix.
#>
#> Vital rate modeling quality control:
#>
#> Survival estimated with 74 individuals and 320 individual transitions.
#> Observation estimated with 70 individuals and 303 individual transitions.
#> Size estimated with 70 individuals and 288 individual transitions.
#> Reproductive status estimated with 70 individuals and 288 individual transitions.
#> Fecundity estimated with 51 individuals and 118 individual transitions.
#> Juvenile survival not estimated.
#> Juvenile observation probability not estimated.
#> Juvenile size transition not estimated.
#> Juvenile reproduction probability not estimated.
#>
#> Survival probability sum check (each matrix represented by column in order):
#> [,1] [,2] [,3] [,4] [,5]
#> Min. 0.100 0.100 0.100 0.100 0.100
#> 1st Qu. 0.963 0.938 0.948 0.958 0.962
#> Median 0.991 0.979 0.984 0.988 0.991
#> Mean 0.904 0.895 0.899 0.904 0.902
#> 3rd Qu. 0.998 0.994 0.996 0.997 0.998
#> Max. 1.000 0.999 0.999 1.000 1.000
#> NULL
summary(cypmatrix2fp_wrong)
#>
#> This ahistorical lefkoMat object contains 15 matrices.
#>
#> Each matrix is a square matrix with 54 rows and columns, and a total of 2916 elements.
#> A total of 36150 survival transitions were estimated, with 2410 per matrix.
#> A total of 720 fecundity transitions were estimated, with 48 per matrix.
#>
#> Vital rate modeling quality control:
#>
#> Survival estimated with 74 individuals and 320 individual transitions.
#> Observation estimated with 70 individuals and 303 individual transitions.
#> Size estimated with 70 individuals and 288 individual transitions.
#> Reproductive status estimated with 70 individuals and 288 individual transitions.
#> Fecundity estimated with 51 individuals and 118 individual transitions.
#> Juvenile survival not estimated.
#> Juvenile observation probability not estimated.
#> Juvenile size transition not estimated.
#> Juvenile reproduction probability not estimated.
#>
#> Survival probability sum check (each matrix represented by column in order):
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12]
#> Min. 0.100 0.100 0.100 0.100 0.100 0.100 0.100 0.100 0.100 0.100 0.100 0.100
#> 1st Qu. 0.951 0.919 0.932 0.946 0.949 0.966 0.942 0.952 0.962 0.965 0.975 0.956
#> Median 0.986 0.969 0.976 0.982 0.985 0.992 0.981 0.986 0.990 0.992 0.996 0.988
#> Mean 0.899 0.887 0.892 0.899 0.897 0.905 0.897 0.901 0.906 0.904 0.908 0.902
#> 3rd Qu. 0.997 0.990 0.993 0.995 0.996 0.999 0.995 0.997 0.998 0.998 0.999 0.997
#> Max. 0.999 0.998 0.999 0.999 0.999 1.000 0.999 0.999 1.000 1.000 1.000 1.000
#> [,13] [,14] [,15]
#> Min. 0.100 0.100 0.100
#> 1st Qu. 0.964 0.971 0.974
#> Median 0.991 0.994 0.995
#> Mean 0.905 0.909 0.906
#> 3rd Qu. 0.998 0.999 0.999
#> Max. 1.000 1.000 1.000
#> NULL
summary(cypmatrix3f_wrong)
#>
#> This historical lefkoMat object contains 5 matrices.
#>
#> Each matrix is a square matrix with 2916 rows and columns, and a total of 8503056 elements.
#> A total of 588545 survival transitions were estimated, with 117709 per matrix.
#> A total of 11760 fecundity transitions were estimated, with 2352 per matrix.
#>
#> Vital rate modeling quality control:
#>
#> Survival estimated with 74 individuals and 320 individual transitions.
#> Observation estimated with 70 individuals and 303 individual transitions.
#> Size estimated with 70 individuals and 288 individual transitions.
#> Reproductive status estimated with 70 individuals and 288 individual transitions.
#> Fecundity estimated with 51 individuals and 118 individual transitions.
#> Juvenile survival not estimated.
#> Juvenile observation probability not estimated.
#> Juvenile size transition not estimated.
#> Juvenile reproduction probability not estimated.
#>
#> Survival probability sum check (each matrix represented by column in order):
#> [,1] [,2] [,3] [,4] [,5]
#> Min. 0.0000 0.000 0.000 0.000 0.000
#> 1st Qu. 0.0743 0.799 0.540 0.322 0.250
#> Median 0.7731 0.989 0.972 0.941 0.919
#> Mean 0.5917 0.771 0.733 0.697 0.673
#> 3rd Qu. 0.9671 0.999 0.997 0.992 0.989
#> Max. 0.9999 1.000 1.000 1.000 1.000
#> NULL
We will come back to this set later in our analyses.
The third issue is matrix dimensionality reduction. Occasionally, historical matrices end up being produced in which stage-pairs exist that are not associated with any transitions. This is particularly the case with raw MPMs. The result is that the rows and columns associated with such a stage pair are completely full of 0s. In such a situation, the matrix can be reduced by eliminating the stage-pair altogether. The result is a set of smaller matrices, which is useful considering that historical MPMs are generally large and can take up lots of memory. We can tell R to develop reduced MPMs by using the reduce = TRUE option in the matrix generating function that we are using. Note that this option is available in ALL matrix generating functions, even for those creating ahistorical MPMs, and that rows and columns will be reduced only if ALL matrices within the lefkoMat object have empty rows and columns associated with a particular stage or stage-pair. Here, we create a reduced function-based hMPM, and then compare it to the unreduced function-based hMPM.
cypmatrix3f_red <- flefko3(stageframe = cypframe_fb, supplement = cypsupp3_fb,
modelsuite = cypmodels3, data = cypfb_v1, yearcol = "year2",
year.as.random = TRUE, reduce = TRUE)
summary(cypmatrix3f_red)
#>
#> This historical lefkoMat object contains 5 matrices.
#>
#> Each matrix is a square matrix with 2458 rows and columns, and a total of 6041764 elements.
#> A total of 588545 survival transitions were estimated, with 117709 per matrix.
#> A total of 11760 fecundity transitions were estimated, with 2352 per matrix.
#>
#> Vital rate modeling quality control:
#>
#> Survival estimated with 74 individuals and 320 individual transitions.
#> Observation estimated with 70 individuals and 303 individual transitions.
#> Size estimated with 70 individuals and 288 individual transitions.
#> Reproductive status estimated with 70 individuals and 288 individual transitions.
#> Fecundity estimated with 51 individuals and 118 individual transitions.
#> Juvenile survival not estimated.
#> Juvenile observation probability not estimated.
#> Juvenile size transition not estimated.
#> Juvenile reproduction probability not estimated.
#>
#> Survival probability sum check (each matrix represented by column in order):
#> [,1] [,2] [,3] [,4] [,5]
#> Min. 0.000 0.000 0.000 0.000 0.000
#> 1st Qu. 0.997 0.997 0.997 0.997 0.997
#> Median 1.000 1.000 1.000 1.000 1.000
#> Mean 0.972 0.972 0.972 0.972 0.972
#> 3rd Qu. 1.000 1.000 1.000 1.000 1.000
#> Max. 1.000 1.000 1.000 1.000 1.000
#> NULL
summary(cypmatrix3f)
#>
#> This historical lefkoMat object contains 5 matrices.
#>
#> Each matrix is a square matrix with 2916 rows and columns, and a total of 8503056 elements.
#> A total of 588545 survival transitions were estimated, with 117709 per matrix.
#> A total of 11760 fecundity transitions were estimated, with 2352 per matrix.
#>
#> Vital rate modeling quality control:
#>
#> Survival estimated with 74 individuals and 320 individual transitions.
#> Observation estimated with 70 individuals and 303 individual transitions.
#> Size estimated with 70 individuals and 288 individual transitions.
#> Reproductive status estimated with 70 individuals and 288 individual transitions.
#> Fecundity estimated with 51 individuals and 118 individual transitions.
#> Juvenile survival not estimated.
#> Juvenile observation probability not estimated.
#> Juvenile size transition not estimated.
#> Juvenile reproduction probability not estimated.
#>
#> Survival probability sum check (each matrix represented by column in order):
#> [,1] [,2] [,3] [,4] [,5]
#> Min. 0.000 0.000 0.000 0.000 0.000
#> 1st Qu. 0.965 0.965 0.965 0.965 0.965
#> Median 1.000 1.000 1.000 1.000 1.000
#> Mean 0.819 0.819 0.819 0.819 0.819
#> 3rd Qu. 1.000 1.000 1.000 1.000 1.000
#> Max. 1.000 1.000 1.000 1.000 1.000
#> NULL
Our new hMPM has matrices with 2458 rows and columns, while the original unreduced hMPM has matrices with 2916 rows and columns. This is a reduction of 458 rows and columns, with an overall reduction in the size of the matrix by \(8503056-6041764 = 2461292\) elements. In memory, the unreduced hMPM takes up 1GB while the reduced hMPM takes up 725MB. So, clearly this reduced set is preferable to the unreduced set.
Fourth, we should consider the issue of the format of the hMPM. By default, we use Ehrlén format, which we find more intuitive and simpler to use. However, some prefer the format outlined in deVries & Caswell (2018). There is only one real difference between these formats, and that is the treatment of an individual that newly recruits in time t. deVries & Caswell (2018) argued that it is not logical to consider maternal state as the stage in time t-1 for an individual transitioning from newborn in time t to whatever its next stage is in time t+1. They therefore suggested that a prior “not yet born” stage should be added to the matrix to deal with issue. Thus, any individuals that is newly-born in time t is treated as having been in this extra stage in time t-1 (note that this stage is not considered as a part of the fecundity transition, but is instead counted ONLY in survival transitions for individuals new to the population in time t). This extra stage yields more stage-pairs in the hMPM, and causes some transitions to be split that would otherwise not be split in Ehrlén format. In any case, analyses using deVries format are not expected to yield any differences analytically from Ehrlén format, but the different matrix dimensions and small differences in treatment of some transitions will likely yield small differences overall here and there. Functions rlefko3() and flefko3() both produce Ehrlén format matrices by default, but users can also produce deVries format matrices by setting format = "deVries", as below.
cypmatrix3f_dev <- flefko3(stageframe = cypframe_fb, supplement = cypsupp3_fb,
modelsuite = cypmodels3, data = cypfb_v1, yearcol = "year2",
year.as.random = TRUE, format = "deVries")
summary(cypmatrix3f_dev)
#>
#> This historical lefkoMat object contains 5 matrices.
#>
#> Each matrix is a square matrix with 2970 rows and columns, and a total of 8820900 elements.
#> A total of 600320 survival transitions were estimated, with 120064 per matrix.
#> A total of 11760 fecundity transitions were estimated, with 2352 per matrix.
#>
#> Vital rate modeling quality control:
#>
#> Survival estimated with 74 individuals and 320 individual transitions.
#> Observation estimated with 70 individuals and 303 individual transitions.
#> Size estimated with 70 individuals and 288 individual transitions.
#> Reproductive status estimated with 70 individuals and 288 individual transitions.
#> Fecundity estimated with 51 individuals and 118 individual transitions.
#> Juvenile survival not estimated.
#> Juvenile observation probability not estimated.
#> Juvenile size transition not estimated.
#> Juvenile reproduction probability not estimated.
#>
#> Survival probability sum check (each matrix represented by column in order):
#> [,1] [,2] [,3] [,4] [,5]
#> Min. 0.000 0.000 0.000 0.000 0.000
#> 1st Qu. 0.965 0.965 0.965 0.965 0.965
#> Median 1.000 1.000 1.000 1.000 1.000
#> Mean 0.819 0.819 0.819 0.819 0.819
#> 3rd Qu. 1.000 1.000 1.000 1.000 1.000
#> Max. 1.000 1.000 1.000 1.000 1.000
#> NULL
summary(cypmatrix3f)
#>
#> This historical lefkoMat object contains 5 matrices.
#>
#> Each matrix is a square matrix with 2916 rows and columns, and a total of 8503056 elements.
#> A total of 588545 survival transitions were estimated, with 117709 per matrix.
#> A total of 11760 fecundity transitions were estimated, with 2352 per matrix.
#>
#> Vital rate modeling quality control:
#>
#> Survival estimated with 74 individuals and 320 individual transitions.
#> Observation estimated with 70 individuals and 303 individual transitions.
#> Size estimated with 70 individuals and 288 individual transitions.
#> Reproductive status estimated with 70 individuals and 288 individual transitions.
#> Fecundity estimated with 51 individuals and 118 individual transitions.
#> Juvenile survival not estimated.
#> Juvenile observation probability not estimated.
#> Juvenile size transition not estimated.
#> Juvenile reproduction probability not estimated.
#>
#> Survival probability sum check (each matrix represented by column in order):
#> [,1] [,2] [,3] [,4] [,5]
#> Min. 0.000 0.000 0.000 0.000 0.000
#> 1st Qu. 0.965 0.965 0.965 0.965 0.965
#> Median 1.000 1.000 1.000 1.000 1.000
#> Mean 0.819 0.819 0.819 0.819 0.819
#> 3rd Qu. 1.000 1.000 1.000 1.000 1.000
#> Max. 1.000 1.000 1.000 1.000 1.000
#> NULL
Our new matrices have 54 more rows and columns, and over 300,000 more elements. To see what is different, compare the hstages element in each on your own, and you will see the inclusion of some new stage pairs with the AlmostBorn stage. Some transitions were split, as well, yielding more transitions that were estimated, though only by about 3000 elements or so.
Finally, we will address the issue of vital rate model accuracy. This issue is generally ignored in most of the function-based MPM / IPM literature, but the truth of the matter is that function-based MPMs are only as good as the vital rate models that they are parameterized with. If the best-fit models determining vital rates are themselves not particularly good descriptions of the demographic data, then they will yield erroneous predictions and analytical results. Ideally, users interested in parameterizing function-based MPMs will assess the overall quality of each of their vital rate models. We are currently in the process of developing some standardized approaches within the modelsearch() and summary() functions for this purpose, but in the meantime we will focus on the accuracy of binomial models.
The quality of vital rate models utilizing a binomial response can be assessed using accuracy, which refers to the ability of a binomial response model to predict the original dataset. For example, we can focus on survival, observation, and reproduction probability.
surv_3f_pred <- round(predict(cypmodels3$survival_model, newdata = cypfb_v1,
type = "response"))
obs_3f_pred <- round(predict(cypmodels3$observation_model,
newdata = subset(cypfb_v1, alive3 == 1), type = "response"))
repst_3f_pred <- round(predict(cypmodels3$repstatus_model,
newdata = subset(cypfb_v1, obsstatus3 == 1), type = "response"))
surv_accuracy <- length(which((surv_3f_pred - cypfb_v1$alive3) == 0)) / length(surv_3f_pred)
obs_accuracy <- length(which((obs_3f_pred - subset(cypfb_v1, alive3 == 1)$obsstatus3) == 0)) /
length(obs_3f_pred)
repst_accuracy <- length(which((repst_3f_pred - subset(cypfb_v1, obsstatus3 == 1)$repstatus3) == 0)) /
length(repst_3f_pred)
writeLines(paste0("Accuracy of survival probability model: ", surv_accuracy))
#> Accuracy of survival probability model: 0.946875
writeLines(paste0("\nAccuracy of observation probability model: ", obs_accuracy))
#>
#> Accuracy of observation probability model: 0.95049504950495
writeLines(paste0("\nAccuracy of reproduction probability model: ", repst_accuracy))
#>
#> Accuracy of reproduction probability model: 0.715277777777778
Our accuracy results suggest that the survival and observation models are pretty good, but the reproduction model is wrong almost 1/3 of the time. This may affect the performance of this model down the line. Let’s also take a look at the size and fecundity models, the former of which uses the size truncated negative binomial distribution and the latter of which uses a zero-inflated Poisson model. Both predict counts.
size_3f_pred <- round(predict(cypmodels3$size_model, newdata = subset(cypfb_v1, obsstatus3 == 1),
type = "response"))
fec_3f_pred <- round(predict(cypmodels3$fecundity_model, newdata = subset(cypfb_v1, repstatus2 == 1),
type = "response"))
table(size_3f_pred, subset(cypfb_v1, obsstatus3 == 1)$size3added)
#>
#> size_3f_pred 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 18 19 21 24
#> 0 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#> 1 68 29 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#> 2 9 23 8 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#> 3 2 2 7 7 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#> 4 3 1 9 12 6 7 1 1 0 0 0 0 0 0 0 0 0 0 0
#> 5 0 1 2 5 10 7 2 2 0 0 0 0 0 0 0 0 0 0 0
#> 6 1 1 0 0 0 4 5 1 0 0 0 0 0 0 0 0 0 0 0
#> 7 0 0 1 0 1 0 2 2 2 0 0 0 0 0 0 0 0 0 0
#> 8 0 0 0 0 0 1 0 1 1 1 1 0 0 0 0 0 0 0 0
#> 9 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0
#> 10 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0
#> 11 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0
#> 14 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
#> 15 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0
#> 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0
#> 18 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
#> 19 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
#> 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0
size_accuracy <- length(which((size_3f_pred - subset(cypfb_v1, obsstatus3 == 1)$size3added) == 0)) /
length(size_3f_pred)
writeLines(paste0("Overall size model accuracy: ", size_accuracy, "\n"))
#> Overall size model accuracy: 0.465277777777778
table(fec_3f_pred, subset(cypfb_v1, repstatus2 == 1)$feca2)
#>
#> fec_3f_pred 0 1 2 3 4 5 7
#> 0 48 8 0 0 0 0 0
#> 1 19 15 6 4 0 0 0
#> 2 1 5 3 3 2 0 0
#> 3 0 0 0 0 0 1 0
#> 4 0 0 1 0 1 0 0
#> 5 0 0 0 0 0 0 1
fec_accuracy <- length(which((fec_3f_pred - subset(cypfb_v1, repstatus2 == 1)$feca2) == 0)) /
length(fec_3f_pred)
writeLines(paste0("Overall fecundity model accuracy: ", fec_accuracy))
#> Overall fecundity model accuracy: 0.567796610169492
Our size and fecundity models predict perfectly only about half of the data that they are supposed to, although the tables suggest that they typically get very close even when they are wrong. Nonetheless, these sorts of deviations may impact our population dynamics predictions.
Now let’s estimate the asymptotic deterministic population growth rate for each of the four sets of patch-level MPMs. We will start by looking at the annual population growth rate estimated from the raw analyses.
cyp2rp_lam <- lambda3(cypmatrix2rp)
cyp2fp_lam <- lambda3(cypmatrix2fp)
cyp3rp_lam <- lambda3(cypmatrix3rp)
cyp3fp_lam <- lambda3(cypmatrix3fp)
plot(lambda ~ year2, data = subset(cyp2rp_lam, patch == "A"),
ylim = c(0, 1.25), type = "l", lwd = 2, bty = "n")
lines(lambda ~ year2, data = subset(cyp2rp_lam, patch == "B"), type = "l",
lwd = 2, lty = 2)
lines(lambda ~ year2, data = subset(cyp2rp_lam, patch == "C"), type = "l",
lwd = 2, lty = 3)
lines(lambda ~ year2, data = subset(cyp3rp_lam, patch == "A"), type = "l",
lwd = 2, lty = 1, col = "red")
lines(lambda ~ year2, data = subset(cyp3rp_lam, patch == "B"), type = "l",
lwd = 2, lty = 2, col = "red")
lines(lambda ~ year2, data = subset(cyp3rp_lam, patch == "C"), type = "l",
lwd = 2, lty = 3, col = "red")
legend("bottomleft", c("A ahistorical", "B ahistorical", "C ahistorical",
"A historical", "B historical", "C historical"), lty = c(1, 2, 3, 1, 2, 3),
col = c("black", "black", "black", "red", "red", "red"), lwd = 2, cex = 0.7,
bty = "n")
Figure 3L.8. Ahistorical vs. historical, raw lambda
Here we see that \(lambda\) is different between the ahistorical and historical cases in the raw MPMs. Let’s compare the results above to the asymptotic deterministic population growth rate in the function-based MPMs.
plot(lambda ~ year2, data = subset(cyp2fp_lam, patch == "A"),
ylim = c(0.75, 1.00), type = "l", lwd = 2, bty = "n")
lines(lambda ~ year2, data = subset(cyp2fp_lam, patch == "B"), type = "l",
lwd = 2, lty = 2)
lines(lambda ~ year2, data = subset(cyp2fp_lam, patch == "C"), type = "l",
lwd = 2, lty = 3)
lines(lambda ~ year2, data = subset(cyp3fp_lam, patch == "A"), type = "l",
lwd = 2, lty = 1, col = "red")
lines(lambda ~ year2, data = subset(cyp3fp_lam, patch == "B"), type = "l",
lwd = 2, lty = 2, col = "red")
lines(lambda ~ year2, data = subset(cyp3fp_lam, patch == "C"), type = "l",
lwd = 2, lty = 3, col = "red")
legend("bottomleft", c("A ahistorical", "B ahistorical", "C ahistorical",
"A historical", "B historical", "C historical"), lty = c(1, 2, 3, 1, 2, 3),
col = c("black", "black", "black", "red", "red", "red"), lwd = 2, cex = 0.7,
bty = "n")
Figure 3L.9. Ahistorical vs. historical, function-based lambda
Note that we see very different predictions from the function-based MPMs than from the raw MPMs here. There are several reasons for this. First, there are strong impacts of the quality and size of the dataset, and of the vital rate models. Raw MPMs are parameterized by the actual transitions that were documented during the study, while the function-based MPMs are parameterized with the vital rate models, which represent process variance and exclude error that cannot be attributed to the modeled factors. In a sufficiently small dataset, many transitions will be lacking in the raw MPMs because there are too few individual to propagate all transition estimates, and in turn these estimates get treated as 0s that artificially drag down some matrix element means and can decrease \(\lambda\). The function-based approach, in contrast, is parameterized by vital rate models that use the dataset as a whole to identify trends, rather than being susceptible to the seemingly random nature in which individuals contribute to transitions. However, smaller datasets will also affect function-based MPMs by yielding vital rate models that are less variable and less influenced by tested factors, as a result of lost statistical power. They are also only as good as their vital rate models, and so there may be an influence of some of the loss of accuracy that we witnessed in the vital rate model for reproductive status, and imperfect prediction of size and fecundity.
A second issue that is less obvious is that our MPMs generally involve case-specific assumptions that can have great effects on predicted population dynamics. The biggest assumption that we make in these MPMs is the nature of fecundity - our model assumes that individuals become seedlings at least 3 years after seed production, and that the numbers of seed produced, the germination rate, the survival probabilities of juvenile stages, and the entry rates into the adult population (i.e. the recruitment rate) are all constant. In truth, the literature suggests that these are all problematic assumptions - the range in seeds produced per pod is likely to range from 500 to over 1,000,000, and adequate estimates of survival probability of any juvenile stage are essentially lacking in wild orchid populations. The most profound break likely comes from the assumptions about the germination rate, because what little literature exists on this topic suggests that germination rate is strongly variable across years, potentially reflecting the strong influence of variability in weather from year to year, and that germination is actually strongly density dependent. Future versions of lefko3 will include density dependence in several forms, but until that time we must assume constant rates that lead to small fluctuations in recruitment from year to year, rather than the large fluctuations actually seen in nature.
The literature has steadily given preference to function-based models like IPMs over the years, but which approach is more appropriate is actually likely to be a strong function of how large a dataset is, and whether the factors utilized truly explain variation in vital rates well.
Now let’s compare the overall \(\lambda\) of the patch-level arithmetic mean matrices, and the stochastic log growth rate, \(a = \text{log} \lambda _{S}\). To make sure that our stochastic growth rate estimates equal yours, we will use the set.seed() function prior to each stochastic run. We will also use the defaults, which include estimation via 10,000 time steps and equivalent time weights.
writeLines("Raw ahistorical lambda:")
#> Raw ahistorical lambda:
lambda3(cyp2rp_mean)
#> pop patch lambda
#> 1 1 A 1.035653
#> 2 1 B 1.151105
#> 3 1 C 1.112109
#> 4 1 0 1.092164
writeLines("\nRaw historical lambda:")
#>
#> Raw historical lambda:
lambda3(cyp3rp_mean)
#> pop patch lambda
#> 1 1 A 0.8220534
#> 2 1 B 0.8157691
#> 3 1 C 0.9050548
#> 4 1 0 0.7819680
writeLines("\nFunction-based ahistorical lambda:")
#>
#> Function-based ahistorical lambda:
lambda3(cyp2fp_mean)
#> pop patch lambda
#> 1 1 A 1.141933
#> 2 1 B 1.109731
#> 3 1 C 1.126202
#> 4 1 0 1.127347
writeLines("\nFunction-based historical lambda:")
#>
#> Function-based historical lambda:
lambda3(cyp3fp_mean)
#> pop patch lambda
#> 1 1 A 0.9536938
#> 2 1 B 0.9581121
#> 3 1 C 0.9616747
#> 4 1 0 0.9578090
writeLines("Raw ahistorical stochastic log lambda:")
#> Raw ahistorical stochastic log lambda:
set.seed(42)
slambda3(cypmatrix2rp)
#> pop patch a var sd se
#> 1 1 A 0.01755652 4.4183458 2.1019862 0.021019862
#> 2 1 B 0.13829938 1.3681927 1.1696977 0.011696977
#> 3 1 C 0.10429814 1.2296795 1.1089092 0.011089092
#> 4 1 0 0.08601101 0.7931451 0.8905869 0.008905869
writeLines("\nRaw historical stochastic log lambda:")
#>
#> Raw historical stochastic log lambda:
set.seed(42)
slambda3(cypmatrix3rp)
#> pop patch a var sd se
#> 1 1 A -0.2238227 6.3215036 2.5142600 0.025142600
#> 2 1 B -0.2352251 2.3058704 1.5185093 0.015185093
#> 3 1 C -0.1237223 3.8913169 1.9726421 0.019726421
#> 4 1 0 -0.2582062 0.9199694 0.9591503 0.009591503
writeLines("\nFunction-based ahistorical stochastic log lambda:")
#>
#> Function-based ahistorical stochastic log lambda:
set.seed(42)
slambda3(cypmatrix2fp)
#> pop patch a var sd se
#> 1 1 A 0.1327791 0.08913877 0.2985612 0.002985612
#> 2 1 B 0.1038148 0.10519642 0.3243400 0.003243400
#> 3 1 C 0.1188518 0.04785819 0.2187652 0.002187652
#> 4 1 0 0.1201040 0.07818130 0.2796092 0.002796092
writeLines("\nFunction-based historical stochastic log lambda:")
#>
#> Function-based historical stochastic log lambda:
set.seed(42)
slambda3(cypmatrix3fp)
#> pop patch a var sd se
#> 1 1 A -0.04737210 0.06632842 0.2575430 0.002575430
#> 2 1 B -0.04276973 0.08600140 0.2932600 0.002932600
#> 3 1 C -0.03901935 0.03228211 0.1796722 0.001796722
#> 4 1 0 -0.04298471 0.05870759 0.2422965 0.002422965
Users will notice at least two trends in the output above. First of all, the most obvious differences are between ahistorical and historical \(\lambda\) and \(\text{log} \lambda _{S}\) values. Generally, ahistorical values of \(\lambda\) are higher than those for historical MPMs. Part of the reason is that the historical MPMs have lost virtually all sensitivity to fecundity rates, and are now basically driven by survival terms (try changing the numbers of seeds per pod at the start of the stage frame input to see the impact of this). However, it is also likely that the difference is driven by long-germ trade-offs captured within the historical models, but not within the ahistorical models. Of particular note is the growth trade-off - we have found large individuals that grew to large size in time t from small size in time t-1 have much lower survival probability to time t+1 (Shefferson, Warren II, and Pulliam 2014).
In addition to the difference between historical and ahistorical growth rate estimates, we see that function-based estimates of \(\lambda\) and \(\text{log} \lambda _{S}\) are higher than those of the raw MPMs. This is likely to be an effect of the extra variance in matrix elements caused by the occasional lack of individuals making some transitions in the raw MPM case, and of the elimination of some vital rate variance from vital rate models.
Under the circumstances, users may wonder which approach is better. While we always advocate using the historical approach over the ahistorical when modeling suggests that history is important, the question of raw vs. function-based is more challenging. All else being equal, larger datasets with more years and more individuals will make both approaches more accurate, but should have a greater influence on inference through the function-based approach than the raw approach. In general, astute, parsimonious life history model construction can make the raw MPM approach very valuable in small datasets, where the raw approach will at least preserve temporal trends in population dynamics better. In contrast, large datasets can give users the ability to explain trends in population dynamics more fully via the parameterization of very good vital rate models that can inform patterns in \(\lambda\) and other metrics.
As a comparison, we might wish to see what our growth rate estimates are when we assume the wrong distributions for size and fecundity.
wrong_mean_p <- lmean(cypmatrix2fp_wrong)
lambda3(wrong_mean_p)
#> pop patch lambda
#> 1 1 A 1.048790
#> 2 1 B 1.091458
#> 3 1 C 1.076001
#> 4 1 0 1.076580
set.seed(42)
slambda3(cypmatrix2fp_wrong)
#> pop patch a var sd se
#> 1 1 A 0.04698545 0.5876349 0.7665735 0.007665735
#> 2 1 B 0.08684956 0.6458347 0.8036384 0.008036384
#> 3 1 C 0.07336002 0.5546849 0.7447717 0.007447717
#> 4 1 0 0.07376722 0.5944518 0.7710070 0.007710070
Notice that our estimates are a little lower than here than for the other function-based MPMs. The fact that they are lower is not necessarily expected - only that they are different.
Now let’s take a look at the stable stage distributions at the population level. We will look at deterministic and stochastic versions of the raw ahistorical and historical MPMs first.
tm2ss_r <- stablestage3(cyp2r_mean)
tm3ss_r <- stablestage3(cyp3r_mean)
tm2ss_rs <- stablestage3(cypmatrix2r, stochastic = TRUE, seed = 42)
tm3ss_rs <- stablestage3(cypmatrix3r, stochastic = TRUE, seed = 42)
ss_put_together <- cbind.data.frame(tm2ss_r$ss_prop, tm3ss_r$ahist$ss_prop,
tm2ss_rs$ss_prop, tm3ss_rs$ahist$ss_prop)
names(ss_put_together) <- c("det ahist", "det hist", "sto ahist", "sto hist")
rownames(ss_put_together) <- tm2ss_r$stage_id
barplot(t(ss_put_together), beside=T, ylab = "Proportion", xlab = "Stage",
ylim = c(0, 0.85), col = c("black", "orangered", "grey", "darkred"), bty = "n")
legend("topright", c("det ahist", "det hist", "sto ahist", "sto hist"),
col = c("black", "orangered", "grey", "darkred"), pch = 15, cex = 0.9, bty = "n")
Figure 3L.10. Ahistorical vs. historically-corrected stable and long-run mean stage distribution, raw MPMs
Overall, these are generally similar patterns but with some very key differences. Whether ahistorical or historical, deterministic or stochastic, our analyses suggest that dormant seeds and 1st year protocorms take up the greatest share of the stable stage structure, with 2nd year protocorms coming next. Adults contribute little to the stable stage structure.
Let’s now compare to the results from the function-based analyses.
tm2ss_f <- stablestage3(cyp2f_mean)
tm3ss_f <- stablestage3(cyp3f_mean)
tm2ss_fs <- stablestage3(cypmatrix2f, stochastic = TRUE, seed = 42)
tm3ss_fs <- stablestage3(cypmatrix3f, stochastic = TRUE, seed = 42)
ss_put_together <- cbind.data.frame(tm2ss_f$ss_prop, tm3ss_f$ahist$ss_prop,
tm2ss_fs$ss_prop, tm3ss_fs$ahist$ss_prop)
names(ss_put_together) <- c("det ahist", "det hist", "sto ahist", "sto hist")
rownames(ss_put_together) <- tm2ss_f$stage_id
barplot(t(ss_put_together), beside=T, ylab = "Proportion", xlab = "Stage",
ylim = c(0, 0.55), col = c("black", "orangered", "grey", "darkred"), bty = "n")
legend("topright", c("det ahist", "det hist", "sto ahist", "sto hist"),
col = c("black", "orangered", "grey", "darkred"), pch = 15, bty = "n")
Figure 3L.11. Ahistorical vs. historically-corrected stable and long-run mean stage distribution, function-based MPMs
If we look over the stageframe used for these MPMs (see the ahstages element of any of the function-based MPMs), we can see that at equilibrium, the population should be composed of the same stages shown to dominate in the raw case - 1st year protocorms and dormant seeds.
Finally, let’s look over the predicted stable stage distribution if we use the wrong size and fecundity distributions.
tm2w_f <- stablestage3(lmean(cypmatrix2f_wrong))
tm2w_fs <- stablestage3(cypmatrix2f_wrong, stochastic = TRUE, seed = 42)
tm3w_f <- stablestage3(lmean(cypmatrix3f_wrong))
tm3w_fs <- stablestage3(cypmatrix3f_wrong, stochastic = TRUE, seed = 42)
ss_put_together <- cbind.data.frame(tm2w_f$ss_prop, tm3w_f$ahist$ss_prop,
tm2w_fs$ss_prop, tm3w_fs$ahist$ss_prop)
names(ss_put_together) <- c("det ahist", "det hist", "sto ahist", "sto hist")
rownames(ss_put_together) <- tm2w_f$stage_id
barplot(t(ss_put_together), beside=T, ylab = "Proportion", xlab = "Stage",
ylim = c(0, 0.55), col = c("black", "orangered", "grey", "darkred"),
bty = "n")
legend("topright", c("det ahist", "det hist", "sto ahist", "sto hist"),
col = c("black", "orangered", "grey", "darkred"), pch = 15, bty = "n")
Figure 3L.12. Ahistorical stable and long-run mean stage distribution, function-based MPMs with wrong size and fecundity distributions
A comparison with the previous graphs shows little difference for now.
Next let’s look at the reproductive values associated with both ahistorical and historical approaches, starting with raw MPMs. We will standardize against the maximum value in each case to make these comparable (note that this is NOT standard practice - we only do it here because of the strong difference in scale across the analyses).
tm2rv_r <- repvalue3(cyp2r_mean)
tm3rv_r <- repvalue3(cyp3r_mean)
tm2rv_rs <- repvalue3(cypmatrix2r, stochastic = TRUE, seed = 42)
tm3rv_rs <- repvalue3(cypmatrix3r, stochastic = TRUE, seed = 42)
rv_put_together <- cbind.data.frame((tm2rv_r$rep_value / max(tm2rv_r$rep_value)),
(tm3rv_r$ahist$rep_value / max(tm3rv_r$ahist$rep_value)),
(tm2rv_rs$rep_value / max(tm2rv_rs$rep_value)),
(tm3rv_rs$ahist$rep_value / max(tm3rv_rs$ahist$rep_value)))
names(rv_put_together) <- c("det ahist", "det hist", "sto ahist", "sto hist")
rownames(rv_put_together) <- tm2rv_r$stage_id
barplot(t(rv_put_together), beside=T, ylab = "Relative rep value", xlab = "Stage",
ylim = c(0, 1.1), col = c("black", "orangered", "grey", "darkred"), bty = "n")
legend("topleft", c("det ahist", "det hist", "sto ahist", "sto hist"),
col = c("black", "orangered", "grey", "darkred"), pch = 15, bty = "n")
Figure 3L.13. Ahistorical vs. historically-corrected deterministic and stochastic reproductive values, raw MPMs
We see some big differences here, particularly between ahistorical and historical analyses. Indeed, in the ahistorical case, reproductive value increases with size, reaching its peak in the largest adults. In contrast, in the historical case, the greatest reproductive values by far are associated with small and medium adults. So, history appears to have large effects here. Interesting results in need of further study!
Now let’s compare with the function-based case.
tm2rv_f <- repvalue3(cyp2f_mean)
tm3rv_f <- repvalue3(cyp3f_mean)
tm2rv_fs <- repvalue3(cypmatrix2f, stochastic = TRUE, seed = 42)
tm3rv_fs <- repvalue3(cypmatrix3f, stochastic = TRUE, seed = 42)
rv_put_together <- cbind.data.frame((tm2rv_f$rep_value / max(tm2rv_f$rep_value)),
(tm3rv_f$ahist$rep_value / max(tm3rv_f$ahist$rep_value)),
(tm2rv_fs$rep_value / max(tm2rv_fs$rep_value)),
(tm3rv_fs$ahist$rep_value / max(tm3rv_fs$ahist$rep_value)))
names(rv_put_together) <- c("det ahist", "det hist", "sto ahist", "sto hist")
rownames(rv_put_together) <- tm2rv_f$stage_id
barplot(t(rv_put_together), beside=T, ylab = "Relative rep value", xlab = "Stage",
ylim = c(0, 1.5), col = c("black", "orangered", "grey", "darkred"), bty = "n")
legend("topleft", c("det ahist", "det hist", "sto ahist", "sto hist"),
col = c("black", "orangered", "grey", "darkred"), pch = 15, cex = 0.8, bty = "n")
Figure 3L.14. Ahistorical vs. historically-corrected deterministic and stochastic reproductive values, function-based MPMs
We see the ahistorical MPMs showing increasing reproductive value with size again. In contrast, the deterministic historical analyses show small and medium adults having high reproductive value while large adults have virtually none (both reproductive and non-reproductive), while the stochastic historical analyses show all adults having roughly equal reproductive value.
Let’s now do a sensitivity analysis, again using both deterministic and stochastic approaches. First we will look at the raw ahistorical MPM.
tm2sens_r <- sensitivity3(cyp2r_mean)
set.seed(42)
tm2sens_rs <- sensitivity3(cypmatrix2r, stochastic = TRUE)
writeLines("\nThe highest deterministic sensitivity value: ")
#>
#> The highest deterministic sensitivity value:
max(tm2sens_r$ah_sensmats[[1]][which(cyp2r_mean$A[[1]] > 0)])
#> [1] 0.9109618
writeLines("\nThis value is associated with element: ")
#>
#> This value is associated with element:
intersect(which(tm2sens_r$ah_sensmats[[1]] == max(tm2sens_r$ah_sensmats[[1]][which(cyp2r_mean$A[[1]] > 0)])), which(cyp2r_mean$A[[1]] > 0))
#> [1] 14
writeLines("\nThe highest stochastic sensitivity value: ")
#>
#> The highest stochastic sensitivity value:
max(tm2sens_rs$ah_sensmats[[1]][which(cyp2r_mean$A[[1]] > 0)])
#> [1] 0.8025366
writeLines("\nThis value is associated with element: ")
#>
#> This value is associated with element:
intersect(which(tm2sens_rs$ah_sensmats[[1]] == max(tm2sens_rs$ah_sensmats[[1]][which(cyp2r_mean$A[[1]] > 0)])), which(cyp2r_mean$A[[1]] > 0))
#> [1] 14
The highest sensitivity value appears to be associated with element 14 in both deterministic and stochastic case. Since there are 11 stages in the stageframe, this means that \(\lambda\) and \(log \lambda\) are most sensitive to the transition from the 2nd stage (1st year protocorm) to the 3rd stage (2nd year protocorm). You can check this by typing, for example, ceiling(14/11) to get the correct column number and 14 %% 11 to get the correct row number for element 14. Let’s compare this to the historical case.
tm3sens_r <- sensitivity3(cyp3r_mean)
set.seed(42)
tm3sens_rs <- sensitivity3(cypmatrix3r, stochastic = TRUE)
writeLines("\nThe highest deterministic sensitivity value: ")
#>
#> The highest deterministic sensitivity value:
max(tm3sens_r$h_sensmats[[1]][which(cyp3r_mean$A[[1]] > 0)])
#> [1] 0.3033102
writeLines("\nThis value is associated with element: ")
#>
#> This value is associated with element:
intersect(which(tm3sens_r$h_sensmats[[1]] == max(tm3sens_r$h_sensmats[[1]][which(cyp3r_mean$A[[1]] > 0)])), which(cyp3r_mean$A[[1]] > 0))
#> [1] 10249
writeLines("\nThe highest stochastic sensitivity value: ")
#>
#> The highest stochastic sensitivity value:
max(tm3sens_rs$h_sensmats[[1]][which(cyp3r_mean$A[[1]] > 0)])
#> [1] 0.3411136
writeLines("\nThis value is associated with element: ")
#>
#> This value is associated with element:
intersect(which(tm3sens_rs$h_sensmats[[1]] == max(tm3sens_rs$h_sensmats[[1]][which(cyp3r_mean$A[[1]] > 0)])), which(cyp3r_mean$A[[1]] > 0))
#> [1] 10249
Here we find that \(\lambda\) and \(log \lambda\) are both most sensitive to element 10249. Looking over the hstages portion, which outlines the 121 stage-pairs corresponding to the rows and column in these matrices, this corresponds to the the transition from the 85th stage pair (Small adult in times t-1 and t), to the 85th stage pair (Small adult in times t and t+1). So, we find here that stasis as a Small adult is most important.
Here is some simple code to help determine the exact stages for a specific element.
# For element 14 in the ahistorical case
writeLines(paste0("Element 14 in cyp2r_mean is associated with column ",
ceiling(14 / dim(cyp2r_mean$ahstages)[1]), " and row ",
(14 %% dim(cyp2r_mean$ahstages)[1])))
#> Element 14 in cyp2r_mean is associated with column 2 and row 3
# For element 10249 in the historical case
writeLines(paste0("Element 10249 in cyp3r_mean is associated with column ",
ceiling(10249 / dim(cyp3r_mean$hstages)[1]), " and row ",
(10249 %% dim(cyp3r_mean$hstages)[1])))
#> Element 10249 in cyp3r_mean is associated with column 85 and row 85
Let’s now compare to the function-based case. We will run both ahistorical and historical portions at the same time.
tm2sens_f <- sensitivity3(cyp2f_mean)
set.seed(42)
tm2sens_fs <- sensitivity3(cypmatrix2f, stochastic = TRUE)
tm3sens_f <- sensitivity3(cyp3f_mean)
set.seed(42)
tm3sens_fs <- sensitivity3(cypmatrix3f, stochastic = TRUE, steps = 500)
writeLines("\nThe highest deterministic ahistorical sensitivity value: ")
#>
#> The highest deterministic ahistorical sensitivity value:
max(tm2sens_f$ah_sensmats[[1]][which(cyp2f_mean$A[[1]] > 0)])
#> [1] 0.9043283
writeLines("\nThis value is associated with element: ")
#>
#> This value is associated with element:
intersect(which(tm2sens_f$ah_sensmats[[1]] == max(tm2sens_f$ah_sensmats[[1]][which(cyp2f_mean$A[[1]] > 0)])), which(cyp2f_mean$A[[1]] > 0))
#> [1] 57
writeLines("\nThe highest stochastic ahistorical sensitivity value: ")
#>
#> The highest stochastic ahistorical sensitivity value:
max(tm2sens_fs$ah_sensmats[[1]][which(cyp2f_mean$A[[1]] > 0)])
#> [1] 0.8044712
writeLines("\nThis value is associated with element: ")
#>
#> This value is associated with element:
intersect(which(tm2sens_fs$ah_sensmats[[1]] == max(tm2sens_fs$ah_sensmats[[1]][which(cyp2f_mean$A[[1]] > 0)])), which(cyp2f_mean$A[[1]] > 0))
#> [1] 57
writeLines("\nThe highest deterministic historical sensitivity value: ")
#>
#> The highest deterministic historical sensitivity value:
max(tm3sens_f$h_sensmats[[1]][which(cyp3f_mean$A[[1]] > 0)])
#> [1] 0.05332836
writeLines("\nThis value is associated with element: ")
#>
#> This value is associated with element:
intersect(which(tm3sens_f$h_sensmats[[1]] == max(tm3sens_f$h_sensmats[[1]][which(cyp3f_mean$A[[1]] > 0)])), which(cyp3f_mean$A[[1]] > 0))
#> [1] 962658
writeLines("\nThe highest stochastic historical sensitivity value: ")
#>
#> The highest stochastic historical sensitivity value:
max(tm3sens_fs$h_sensmats[[1]][which(cyp3f_mean$A[[1]] > 0)])
#> [1] 0.05482719
writeLines("\nThis value is associated with element: ")
#>
#> This value is associated with element:
intersect(which(tm3sens_fs$h_sensmats[[1]] == max(tm3sens_fs$h_sensmats[[1]][which(cyp3f_mean$A[[1]] > 0)])), which(cyp3f_mean$A[[1]] > 0))
#> [1] 962658
The highest sensitivity value in deterministic and stochastic ahistorical analysis appears to be the transition from 1st year protocorm to 2nd year protocorm. Inspecting each sensitivity matrix also shows that transitions near that element in both matrices are also associated with rather high sensitivities. Both deterministic and stochastic historical analyses suggest the strongest sensitivity in response to element 962658. Element 962658 is the transition from 1-sprouted vegetative adult in times t-1 and t to 24-sprouted flowering adult in time t+1 (column 331 and row 378). So, we continue to see that ahistorical analyses are suggesting a strong influence of the earliest stages on life, while historical analyses are suggesting a stronger influence of later adult stages.
Let’s now assess the elasticity of \(\lambda\) to matrix elements, comparing the ahistorical to the historically-corrected case in both deterministic and stochastic analyses.
tm2elas_r <- elasticity3(cyp2r_mean)
tm3elas_r <- elasticity3(cyp3r_mean)
set.seed(42)
tm2elas_rs <- elasticity3(cypmatrix2r, stochastic = TRUE)
set.seed(42)
tm3elas_rs <- elasticity3(cypmatrix3r, stochastic = TRUE)
writeLines("\nThe largest ahistorical deterministic elasticity is associated with element: ")
#>
#> The largest ahistorical deterministic elasticity is associated with element:
which(tm2elas_r$ah_elasmats[[1]] == max(tm2elas_r$ah_elasmats[[1]]))
#> [1] 85
writeLines("\nThe largest historically-corrected deterministic elasticity is associated with element: ")
#>
#> The largest historically-corrected deterministic elasticity is associated with element:
which(tm3elas_r$ah_elasmats[[1]] == max(tm3elas_r$ah_elasmats[[1]]))
#> [1] 85
writeLines("\nThe largest historical deterministic elasticity is associated with element: ")
#>
#> The largest historical deterministic elasticity is associated with element:
which(tm3elas_r$h_elasmats[[1]] == max(tm3elas_r$h_elasmats[[1]]))
#> [1] 10249
writeLines("\nThe largest ahistorical stochastic elasticity is associated with element: ")
#>
#> The largest ahistorical stochastic elasticity is associated with element:
which(tm2elas_rs$ah_elasmats[[1]] == max(tm2elas_rs$ah_elasmats[[1]]))
#> [1] 85
writeLines("\nThe largest historically-corrected stochastic elasticity is associated with element: ")
#>
#> The largest historically-corrected stochastic elasticity is associated with element:
which(tm3elas_rs$ah_elasmats[[1]] == max(tm3elas_rs$ah_elasmats[[1]]))
#> [1] 85
writeLines("\nThe largest historical stochastic elasticity is associated with element: ")
#>
#> The largest historical stochastic elasticity is associated with element:
which(tm3elas_rs$h_elasmats[[1]] == max(tm3elas_rs$h_elasmats[[1]]))
#> [1] 10249
Here we see something interesting - the ahistorical and historical analyses are generally agreeing about which transitions \(\lambda\) is most elastic in response to, as are the deterministic and stochastic. Here we see that \(\lambda\) and \(\text{log} \lambda _{S}\) are most elastic across the board to the ahistorical stasis transition from Small adult in time t to Small adult in time t+1, and the historical stasis transition as Small adult in times t-1, t, and t+1. This is a very different result from sensitivity analysis, and likely relates to differences the nature of the perturbation assessed in each case.
Let’s now look at the function-based case.
tm2elas_f <- elasticity3(cyp2f_mean)
tm3elas_f <- elasticity3(cyp3f_mean)
set.seed(42)
tm2elas_fs <- elasticity3(cypmatrix2f, stochastic = TRUE)
set.seed(42)
tm3elas_fs <- elasticity3(cypmatrix3f, stochastic = TRUE, steps = 500)
writeLines("\nThe largest ahistorical deterministic elasticity is associated with element: ")
#>
#> The largest ahistorical deterministic elasticity is associated with element:
which(tm2elas_f$ah_elasmats[[1]] == max(tm2elas_f$ah_elasmats[[1]]))
#> [1] 57
writeLines("\nThe largest historically-corrected deterministic elasticity is associated with element: ")
#>
#> The largest historically-corrected deterministic elasticity is associated with element:
which(tm3elas_f$ah_elasmats[[1]] == max(tm3elas_f$ah_elasmats[[1]]))
#> [1] 331
writeLines("\nThe largest historical deterministic elasticity is associated with element: ")
#>
#> The largest historical deterministic elasticity is associated with element:
which(tm3elas_f$h_elasmats[[1]] == max(tm3elas_f$h_elasmats[[1]]))
#> [1] 962611
writeLines("\nThe largest ahistorical stochastic elasticity is associated with element: ")
#>
#> The largest ahistorical stochastic elasticity is associated with element:
which(tm2elas_fs$ah_elasmats[[1]] == max(tm2elas_fs$ah_elasmats[[1]]))
#> [1] 57
writeLines("\nThe largest historically-corrected stochastic elasticity is associated with element: ")
#>
#> The largest historically-corrected stochastic elasticity is associated with element:
which(tm3elas_fs$ah_elasmats[[1]] == max(tm3elas_fs$ah_elasmats[[1]]))
#> [1] 331
writeLines("\nThe largest historical stochastic elasticity is associated with element: ")
#>
#> The largest historical stochastic elasticity is associated with element:
which(tm3elas_fs$h_elasmats[[1]] == max(tm3elas_fs$h_elasmats[[1]]))
#> [1] 962611
Element 57 is the transition from 1st year to 2nd year protocorm. In contrast, element 331 corresponds to the ahistorical stasis transition in one-sprouted vegetative adults, and element 962611 corresponds to the historical stasis transition in this stage. So, here we see that historical analyses generally favor the adult stages, while ahistorical analyses emphasize the early stages.
Now let’s compare the elasticity of population growth rate in relation to the core life history stages, via a barplot comparison.
elas_put_together <- cbind.data.frame(colSums(tm2elas_f$ah_elasmats[[1]]),
colSums(tm3elas_f$ah_elasmats[[1]]), colSums(tm2elas_fs$ah_elasmats[[1]]),
colSums(tm3elas_fs$ah_elasmats[[1]]))
names(elas_put_together) <- c("det ahist", "det hist", "sto ahist", "sto hist")
rownames(elas_put_together) <- tm2elas_f$ah_stages$stage_id
barplot(t(elas_put_together), beside=T, ylab = "Elasticity", xlab = "Stage",
col = c("black", "orangered", "grey", "darkred"), ylim = c(0, 0.20), bty = "n")
legend("topright", c("det ahist", "det hist", "sto ahist", "sto hist"),
col = c("black", "orangered", "grey", "darkred"), pch = 15, bty = "n")
Figure 3L.15. Ahistorical vs. historically-corrected deterministic and stochastic elasticity to stage, function-based
Elasticity analyses in these plots look quite different. The ahistorical analyses show that \(\lambda\) and \(\text{log} \lambda _{S}\) should be most elastic in response to shifts in transitions from the juvenile stages. In contrast, historical analyses show that \(\lambda\) and \(\text{log} \lambda _{S}\) should be most elastic in response to transitions from small adult stages, especially non-flowering ones. We tend to side with the historical interpretation, but leave it up to the user to make their own determination.
Finally, let’s take a look at how the importance of different kinds of transitions changes, by looking at elasticity sums.
tm2elas_f_sums <- summary(tm2elas_f)
tm3elas_f_sums <- summary(tm3elas_f)
tm2elas_fs_sums <- summary(tm2elas_fs)
tm3elas_fs_sums <- summary(tm3elas_fs)
elas_sums_together <- cbind.data.frame(tm2elas_f_sums$ahist[,2],
tm3elas_f_sums$ahist[,2], tm2elas_fs_sums$ahist[,2], tm3elas_fs_sums$ahist[,2])
names(elas_sums_together) <- c("det ahist", "det hist", "sto ahist", "sto hist")
rownames(elas_sums_together) <- tm2elas_f_sums$ahist$category
barplot(t(elas_sums_together), beside=T, ylab = "Elasticity", xlab = "Transition",
col = c("black", "orangered", "grey", "darkred"), bty = "n")
legend("topright", c("det ahist", "det hist", "sto ahist", "sto hist"),
col = c("black", "orangered", "grey", "darkred"), pch = 15, bty = "n")
Figure 3L.16. Ahistorical vs. historically-corrected elasticity of lambda to transitions, function-based
Fecundity makes least difference in all cases, although it does influence ahistorical analysis a reasonable amount. Growth, in contrast, appears to be among the most important transition types across the board. Stasis is more important in ahistorical than in historical analyses, and shrinkage shows the reverse pattern. Next, we can see which historical transitions are most important.
elas_hist2plot <- cbind.data.frame(tm3elas_f_sums$hist[,2],
tm3elas_fs_sums$hist[,2])
names(elas_hist2plot) <- c("det hist", "sto hist")
rownames(elas_hist2plot) <- tm3elas_f_sums$hist$category
par(mar = c(7, 4, 2, 2) + 0.2)
barplot(t(elas_hist2plot), beside = T, ylab = "Elasticity", xlab = "", xaxt = "n",
col = c("orangered", "darkred"), bty = "n")
text(cex=0.75, x=seq(from = 0.2, to = 2.9*length(tm3elas_f_sums$hist$category), by = 2.95),
y=-0.03, tm3elas_f_sums$hist$category, xpd=TRUE, srt=45)
legend("topright", c("det hist", "sto hist"),
col = c("orangered", "darkred"), pch = 15, bty = "n")
Figure 3L.17. Elasticity of lambda to historical transitions, function-based
We can see that growth from occasion t-1 to t followed by shrinkage to occasion t+1 is associated with the greatest summed elasticities, while the inverse, shrinkage from occasion t-1 to t followed by growth to occasion t+1 is the next most important. Transitions associated with fecundity are associated with the lowest summed elasticities.
The most recent versions of lefko3 incorporate a basic projection function, projection3(). Originally, this function was developed to create simple deterministic and stochastic projections of varying lengths and complexity, with output including growth rate, stage structure, and reproductive value per time step, with a number of options designed to streamline analysis. We are adding further power to this function with each new version of lefko3, and beginning with version 3.8.0, we have included replication.
We will demonstrate by using this function to conduct a quasi-extinction analysis. Let’s use the function-based ahistorical MPM to illustrate this, using this function to create 100 stochastic replicates of a population projection.
set.seed(42)
cypproj_3r <- projection3(cypmatrix3r, nreps = 100, stochastic = TRUE, integeronly = TRUE)
Now let’s take a look at the resulting object, which is a list of class lefkoProj. We will not output the whole object because it is quite long. Instead, let’s first look at the elements that constitute it.
names(cypproj_3r)
#> [1] "projection" "labels" "ahstages" "hstages" "agestages"
#> [6] "control"
We see 6 elements, with 4 seemingly familiar - ahstages is the stage frame from the input MPM, hstages is a data frame showing the order of historical stage pairs (only provided if an hMPM is used as input), and agestages is a data frame showing the order of age-stages (only provided if an age-by-stage MPM is used as input). The element named control is a short vector giving the number of replicates followed by the number of time steps projected. And the most important element is projection, which is a matrix showing the stage structure in each of the 100 replicates that we created. The dimensions of this matrix will make the matter clearer:
dim(cypproj_3r$projection[[1]])
#> [1] 12100 10001
We see that there are 12,100 rows and 10,001 columns. The columns correspond to the discrete times that we have projected. The rows correspond to the 121 stage-pairs in each of the 100 replicates, with each replicate together. Thus, the first 121 rows correspond to the numbers of individuals in each stage at each time in replicate 1. Rows 122-242 correspond to the numbers of individuals in each stage at each time in replicate 2, etc. Lets’s take a look at the first few time steps of replicate 1.
cypproj_3r$projection[[1]][1:121,1:10]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> [1,] 1 0 333 419 707 257 127 63 0 0
#> [2,] 1 1 1333 1699 2854 1070 525 262 6 0
#> [3,] 1 0 0 0 0 0 0 0 0 0
#> [4,] 1 0 0 0 0 0 0 0 0 0
#> [5,] 1 0 0 0 0 0 0 0 0 0
#> [6,] 1 0 0 0 0 0 0 0 0 0
#> [7,] 1 0 0 0 0 0 0 0 0 0
#> [8,] 1 0 0 0 0 0 0 0 0 0
#> [9,] 1 0 0 0 0 0 0 0 0 0
#> [10,] 1 0 0 0 0 0 0 0 0 0
#> [11,] 1 0 0 0 0 0 0 0 0 0
#> [12,] 1 0 0 0 0 0 0 0 0 0
#> [13,] 1 0 0 0 0 0 0 0 0 0
#> [14,] 1 0 0 133 169 285 107 52 26 0
#> [15,] 1 0 0 0 0 0 0 0 0 0
#> [16,] 1 0 0 0 0 0 0 0 0 0
#> [17,] 1 0 0 0 0 0 0 0 0 0
#> [18,] 1 0 0 0 0 0 0 0 0 0
#> [19,] 1 0 0 0 0 0 0 0 0 0
#> [20,] 1 0 0 0 0 0 0 0 0 0
#> [21,] 1 0 0 0 0 0 0 0 0 0
#> [22,] 1 0 0 0 0 0 0 0 0 0
#> [23,] 1 0 0 0 0 0 0 0 0 0
#> [24,] 1 0 0 0 0 0 0 0 0 0
#> [25,] 1 0 0 0 0 0 0 0 0 0
#> [26,] 1 0 0 0 13 16 28 10 5 2
#> [27,] 1 0 0 0 0 0 0 0 0 0
#> [28,] 1 0 0 0 0 0 0 0 0 0
#> [29,] 1 0 0 0 0 0 0 0 0 0
#> [30,] 1 0 0 0 0 0 0 0 0 0
#> [31,] 1 0 0 0 0 0 0 0 0 0
#> [32,] 1 0 0 0 0 0 0 0 0 0
#> [33,] 1 0 0 0 0 0 0 0 0 0
#> [34,] 1 0 0 0 0 0 0 0 0 0
#> [35,] 1 0 0 0 0 0 0 0 0 0
#> [36,] 1 0 0 0 0 0 0 0 0 0
#> [37,] 1 0 0 0 0 0 0 0 0 0
#> [38,] 1 0 0 0 0 0 0 1 0 0
#> [39,] 1 0 0 0 0 0 0 0 0 0
#> [40,] 1 0 0 0 0 0 0 0 0 0
#> [41,] 1 0 0 0 0 0 0 0 0 0
#> [42,] 1 0 0 0 0 0 0 0 0 0
#> [43,] 1 0 0 0 0 0 0 0 0 0
#> [44,] 1 0 0 0 0 0 0 0 0 0
#> [45,] 1 0 0 0 0 0 0 0 0 0
#> [46,] 1 0 0 0 0 0 0 0 0 0
#> [47,] 1 0 0 0 0 0 0 0 0 0
#> [48,] 1 0 0 0 0 0 0 0 0 0
#> [49,] 1 0 0 0 0 0 0 0 0 0
#> [50,] 1 0 0 0 0 0 0 0 0 0
#> [51,] 1 0 0 0 0 0 0 0 0 0
#> [52,] 1 0 0 0 0 0 0 0 0 0
#> [53,] 1 0 0 0 0 0 0 0 0 0
#> [54,] 1 0 0 0 0 0 0 0 0 0
#> [55,] 1 0 0 0 0 0 0 0 0 0
#> [56,] 1 0 0 0 0 0 0 0 0 0
#> [57,] 1 0 0 0 0 0 0 0 0 0
#> [58,] 1 0 0 0 0 0 0 0 0 0
#> [59,] 1 0 0 0 0 0 0 0 0 0
#> [60,] 1 0 0 0 0 0 0 0 0 0
#> [61,] 1 0 0 0 0 0 0 0 0 0
#> [62,] 1 2 0 0 0 0 0 0 0 0
#> [63,] 1 1 0 0 0 0 0 0 0 0
#> [64,] 1 0 0 0 0 0 0 0 0 0
#> [65,] 1 0 0 0 0 0 0 0 0 0
#> [66,] 1 0 0 0 0 0 0 0 0 0
#> [67,] 1 0 0 0 0 0 0 0 0 0
#> [68,] 1 0 0 0 0 0 0 0 0 0
#> [69,] 1 0 0 0 0 0 0 0 0 0
#> [70,] 1 0 0 0 0 0 0 0 0 0
#> [71,] 1 0 0 0 0 0 0 0 0 0
#> [72,] 1 0 0 0 0 0 0 0 0 0
#> [73,] 1 2 3 1 0 0 0 0 0 0
#> [74,] 1 1 0 0 0 0 0 0 0 0
#> [75,] 1 0 0 0 0 0 0 0 0 0
#> [76,] 1 0 0 0 0 0 0 0 0 0
#> [77,] 1 0 0 0 0 0 0 0 0 0
#> [78,] 1 0 0 1562 0 0 0 0 0 0
#> [79,] 1 0 0 1562 0 0 0 0 0 0
#> [80,] 1 0 0 0 0 0 0 0 0 0
#> [81,] 1 0 0 0 0 0 0 0 0 0
#> [82,] 1 0 0 0 0 0 0 0 0 0
#> [83,] 1 0 0 0 0 0 0 0 0 0
#> [84,] 1 0 0 0 0 0 0 0 0 0
#> [85,] 1 2 2 1 0 0 0 0 0 0
#> [86,] 1 0 0 0 0 0 0 0 0 0
#> [87,] 1 0 0 0 0 0 0 0 0 0
#> [88,] 1 0 0 0 0 0 0 0 0 0
#> [89,] 1 2916 3333 2500 0 0 0 0 0 0
#> [90,] 1 2916 3333 2500 0 0 0 0 0 0
#> [91,] 1 0 0 0 0 0 0 0 0 0
#> [92,] 1 0 0 0 0 0 0 0 0 0
#> [93,] 1 0 0 0 0 0 0 0 0 0
#> [94,] 1 0 0 0 0 0 0 0 0 0
#> [95,] 1 0 0 0 0 0 0 0 0 0
#> [96,] 1 0 0 0 0 0 0 0 0 0
#> [97,] 1 2 1 0 0 0 0 0 0 0
#> [98,] 1 1 0 0 0 0 0 0 0 0
#> [99,] 1 0 0 0 0 0 0 0 0 0
#> [100,] 1 2500 5000 10000 5000 2500 1250 0 0 0
#> [101,] 1 2500 5000 10000 5000 2500 1250 0 0 0
#> [102,] 1 0 0 0 0 0 0 0 0 0
#> [103,] 1 0 0 0 0 0 0 0 0 0
#> [104,] 1 0 0 0 0 0 0 0 0 0
#> [105,] 1 0 0 0 0 0 0 0 0 0
#> [106,] 1 0 0 0 0 0 0 0 0 0
#> [107,] 1 0 0 0 0 0 0 0 0 0
#> [108,] 1 0 0 0 0 0 0 0 0 0
#> [109,] 1 2 2 2 2 1 0 0 0 0
#> [110,] 1 0 0 0 0 1 0 0 0 0
#> [111,] 1 1250 0 0 0 0 0 0 0 0
#> [112,] 1 1250 0 0 0 0 0 0 0 0
#> [113,] 1 0 0 0 0 0 0 0 0 0
#> [114,] 1 0 0 0 0 0 0 0 0 0
#> [115,] 1 0 0 0 0 0 0 0 0 0
#> [116,] 1 0 0 0 0 0 0 0 0 0
#> [117,] 1 0 0 0 0 0 0 0 0 0
#> [118,] 1 0 0 0 0 0 0 0 0 0
#> [119,] 1 0 0 0 0 0 0 0 0 0
#> [120,] 1 0 0 0 0 0 0 0 0 0
#> [121,] 1 1 0 0 0 0 0 0 0 0
You may notice that the population seems to be declining here. This is not a shock - all of our historical MPMs suggest a declining population. Let’s use the summary.lefkoProj() function to get a better handle on this.
summary(cypproj_3r)
#>
#> The input lefkoProj object covers 1 population-patches.
#> It includes 10000 projected steps per replicate and 100 replicates.
#> The number of replicates with population size above the threshold size of 1 is as in the following matrix, with pop-patches given by column and milepost times given by row:
#>
#> 1 1
#> 1 100
#> 2501 0
#> 5001 0
#> 7501 0
#> 10001 0
#> NULL
This summary gives us some basic information about our projection, and also shows us the number of replicates with more than 1 individual projected alive at a series of projected times (times 1, 2501, 5001, 7501, and 10001). We can change these milepost times, using either proportions or explicit times, as below.
summary(cypproj_3r, milepost = c(1, 3, 5, 8, 9, 10, 15, 100, 10001))
#>
#> The input lefkoProj object covers 1 population-patches.
#> It includes 10000 projected steps per replicate and 100 replicates.
#> The number of replicates with population size above the threshold size of 1 is as in the following matrix, with pop-patches given by column and milepost times given by row:
#>
#> 1 1
#> 1 100
#> 3 100
#> 5 100
#> 8 66
#> 9 40
#> 10 20
#> 15 1
#> 100 0
#> 10001 0
#> NULL
The output above gives us a sense that the population is declining quite quickly - indeed, only 1 replicate still has at least 1 individual alive in time 15. The summary.lefkoProj() function can also be used to output population sizes projected under each replicate, so that we can plot the results. We can use the sums_out option for this purpose. Here is an example.
proj_sums3 <- summary(cypproj_3r, sums_out = TRUE)
#>
#> The input lefkoProj object covers 1 population-patches.
#> It includes 10000 projected steps per replicate and 100 replicates.
#> The number of replicates with population size above the threshold size of 1 is as in the following matrix, with pop-patches given by column and milepost times given by row:
#>
#> 1 1
#> 1 100
#> 2501 0
#> 5001 0
#> 7501 0
#> 10001 0
plot(proj_sums3$mat_sums[[1]][1,c(1:25)], ylim = c(0, 100000), type = "l", lwd = 2,
lty = 2, xlab = "Time", ylab = "Projected N")
apply(as.matrix(c(2:100)), 1, function(X) {
lines(proj_sums3$mat_sums[[1]][X,c(1:25)], lwd = 2, lty = 2)
})
Figure 3L.18. Projected population size across time over 100 replicates and 10,000 time steps for the ahistorical function-based MPM
#> NULL
In the above plot, we show the results of each population projection for the first 25 projected occasions. All 100 replicates go to extinction, of course. If our MPM had higher population growth rates, then we might have had only some go to extinction. In that case, we could see the number of replicates with surviving individuals at particular points in time, and estimate the time to extinction. For example, if 95% of replicates have died out by 100 occasions, then this analysis would suggest extinction within that time. Quasi-extinction analysis would use this number against another series of replicates set up under a different set of assumptions to assess extinction. For example, we could run another analysis of data from the same population but a different patch that has been subjected to a different management regime, and compare the time to extinction in each. If the management regime is associated with increased population lifespan, then the probability of extinction is considered lower under the management scenario.
As a comparison point, let’s also look at a projection of the function-based historical MPM and compare it. We will not project out 10,000 time steps, but only 200, to limit the amount of time needed for analysis. Then, we will plot our results as before.
set.seed(42)
cypproj_3f <- projection3(cypmatrix3f, nreps = 100, times = 200,
stochastic = TRUE, integeronly = TRUE)
proj_sums3f <- summary(cypproj_3f, sums_out = TRUE)
#>
#> The input lefkoProj object covers 1 population-patches.
#> It includes 200 projected steps per replicate and 100 replicates.
#> The number of replicates with population size above the threshold size of 1 is as in the following matrix, with pop-patches given by column and milepost times given by row:
#>
#> 1 1
#> 1 100
#> 51 0
#> 101 0
#> 151 0
#> 201 0
plot(proj_sums3f$mat_sums[[1]][1,c(1:100)], ylim = c(0, 6000000), type = "l", lwd = 2,
lty = 2, xlab = "Time", ylab = "Projected N")
apply(as.matrix(c(2:100)), 1, function(X) {
lines(proj_sums3f$mat_sums[[1]][X,c(1:100)], lwd = 2, lty = 2)
})
Figure 3L.19. Projected population size across time over 100 replicates and 10,000 time steps for the historical function-based MPM
#> NULL
The function-based historical analysis also suggests inevitable extinction, and quite quickly. In this case, we start with a higher number of individuals because the population projections start either with 1 individual per stage (in ahistorical analysis), or 1 individual per stage-pair (in historical analysis). So, we started with 121 individuals in the raw MPM case, but with 2,916 individuals in the function-based case. Nonetheless, extinction is quite quick, and leaves us to wonder how to boost the growth rate.
As a final analysis, we might try a comparison of our population using the raw MPM, under the current conditions against a scenario where we somehow double germination to around 30%. To do this analysis, we need to create a new set of MPMs under this new assumption. First, we will set up a new supplement table using this assumption, using the hMPM approach. Then we will take a look at it relative to the original supplement table.
cypsupp3_raw_2 <- supplemental(stage3 = c("SD", "SD", "P1", "P1", "P2", "P3",
"SL", "SL", "SL", "D", "D", "SD", "P1"),
stage2 = c("SD", "SD", "SD", "SD", "P1", "P2", "P3", "SL", "SL", "SL",
"SL", "rep", "rep"),
stage1 = c("SD", "rep", "SD", "rep", "SD", "P1", "P2", "P3", "SL",
"P3", "SL", "mat", "mat"),
eststage3 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, "XSm", "D", NA,
NA),
eststage2 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, "XSm", "XSm",
NA, NA),
eststage1 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, "XSm", "XSm",
NA, NA),
givenrate = c(0.01, 0.05, 0.25, 0.35, 0.1, 0.1, 0.05, 0.05, 0.05, NA, NA,
NA, NA),
multiplier = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
(0.5 * seeds_per_pod), (0.5 * seeds_per_pod)),
type = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3),
type_t12 = c(1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1),
stageframe = cypframe_raw, historical = TRUE)
cypsupp3_raw_2
#> stage3 stage2 stage1 eststage3 eststage2 eststage1 givenrate multiplier
#> 1 SD SD SD <NA> <NA> <NA> 0.01 NA
#> 2 SD SD rep <NA> <NA> <NA> 0.05 NA
#> 3 P1 SD SD <NA> <NA> <NA> 0.25 NA
#> 4 P1 SD rep <NA> <NA> <NA> 0.35 NA
#> 5 P2 P1 SD <NA> <NA> <NA> 0.10 NA
#> 6 P3 P2 P1 <NA> <NA> <NA> 0.10 NA
#> 7 SL P3 P2 <NA> <NA> <NA> 0.05 NA
#> 8 SL SL P3 <NA> <NA> <NA> 0.05 NA
#> 9 SL SL SL <NA> <NA> <NA> 0.05 NA
#> 10 D SL P3 XSm XSm XSm NA NA
#> 11 D SL SL D XSm XSm NA NA
#> 12 SD rep mat <NA> <NA> <NA> NA 2500
#> 13 P1 rep mat <NA> <NA> <NA> NA 2500
#> convtype convtype_t12
#> 1 1 1
#> 2 1 2
#> 3 1 1
#> 4 1 2
#> 5 1 1
#> 6 1 1
#> 7 1 1
#> 8 1 1
#> 9 1 1
#> 10 1 1
#> 11 1 1
#> 12 3 1
#> 13 3 1
cypsupp3_raw
#> stage3 stage2 stage1 eststage3 eststage2 eststage1 givenrate multiplier
#> 1 SD SD SD <NA> <NA> <NA> 0.01 NA
#> 2 SD SD rep <NA> <NA> <NA> 0.05 NA
#> 3 P1 SD SD <NA> <NA> <NA> 0.10 NA
#> 4 P1 SD rep <NA> <NA> <NA> 0.20 NA
#> 5 P2 P1 SD <NA> <NA> <NA> 0.10 NA
#> 6 P3 P2 P1 <NA> <NA> <NA> 0.10 NA
#> 7 SL P3 P2 <NA> <NA> <NA> 0.05 NA
#> 8 SL SL P3 <NA> <NA> <NA> 0.05 NA
#> 9 SL SL SL <NA> <NA> <NA> 0.05 NA
#> 10 D SL P3 XSm XSm XSm NA NA
#> 11 D SL SL D XSm XSm NA NA
#> 12 SD rep mat <NA> <NA> <NA> NA 2500
#> 13 P1 rep mat <NA> <NA> <NA> NA 2500
#> convtype convtype_t12
#> 1 1 1
#> 2 1 2
#> 3 1 1
#> 4 1 2
#> 5 1 1
#> 6 1 1
#> 7 1 1
#> 8 1 1
#> 9 1 1
#> 10 1 1
#> 11 1 1
#> 12 3 1
#> 13 3 1
The primary difference here is in lines 3 and 4, where we see germination rate from a recently formed seed, and from a seedling that has been a seedling for longer.
Now let’s create the new hMPMs.
cypmatrix3r_2 <- rlefko3(data = cypraw_v1, stageframe = cypframe_raw,
year = "all", stages = c("stage3", "stage2", "stage1"),
size = c("size3added", "size2added", "size1added"),
supplement = cypsupp3_raw_2, yearcol = "year2", patchcol = "patchid",
indivcol = "individ")
summary(cypmatrix3r_2)
#>
#> This historical lefkoMat object contains 4 matrices.
#>
#> Each matrix is a square matrix with 121 rows and columns, and a total of 14641 elements.
#> A total of 188 survival transitions were estimated, with 47 per matrix.
#> A total of 52 fecundity transitions were estimated, with 13 per matrix.
#>
#> The dataset contains a total of 74 unique individuals and 320 unique transitions.
#>
#> Survival probability sum check (each matrix represented by column in order):
#> [,1] [,2] [,3] [,4]
#> Min. 0.00 0.000 0.000 0.000
#> 1st Qu. 0.00 0.000 0.000 0.000
#> Median 0.00 0.000 0.000 0.000
#> Mean 0.15 0.157 0.155 0.171
#> 3rd Qu. 0.00 0.000 0.000 0.000
#> Max. 1.00 1.000 1.000 1.000
#> NULL
Let’s take a quick look at our \(\lambda\) estimates to see if the population growth rare has increased.
lambda3(cypmatrix3r_2)
#> pop patch year2 lambda
#> 1 1 1 2005 0.8396288
#> 2 1 1 2006 1.0000000
#> 3 1 1 2007 0.9180329
#> 4 1 1 2008 1.0000000
lambda3(cypmatrix3r)
#> pop patch year2 lambda
#> 1 1 1 2005 0.8396288
#> 2 1 1 2006 1.0000000
#> 3 1 1 2007 0.9180329
#> 4 1 1 2008 1.0000000
We do not really see any increase, but then again this is an assessment of deterministic growth rate while our projection will be stochastic. In any case, let’s conduct our new projections, and then plot them against the original hMPM projections.
set.seed(42)
cypproj_3r_2 <- projection3(cypmatrix3r_2, nreps = 100, times = 200,
stochastic = TRUE, integeronly = TRUE)
proj_sums3_2 <- summary(cypproj_3r_2, sums_out = TRUE)
#>
#> The input lefkoProj object covers 1 population-patches.
#> It includes 200 projected steps per replicate and 100 replicates.
#> The number of replicates with population size above the threshold size of 1 is as in the following matrix, with pop-patches given by column and milepost times given by row:
#>
#> 1 1
#> 1 100
#> 51 0
#> 101 0
#> 151 0
#> 201 0
plot(proj_sums3$mat_sums[[1]][1,c(1:100)], ylim = c(0, 100500), type = "l", lwd = 2,
lty = 2, xlab = "Time", ylab = "Projected N")
apply(as.matrix(c(2:100)), 1, function(X) {
lines(proj_sums3$mat_sums[[1]][X,c(1:100)], lwd = 2, lty = 2)
})
#> NULL
apply(as.matrix(c(1:100)), 1, function(X) {
lines(proj_sums3_2$mat_sums[[1]][X,c(1:100)], lwd = 2, lty = 2, col = "red")
})
Figure 3L.20. Projected population comparison of hMPMs with original fecundity vs 50% fecundity boost
#> NULL
We do not see much of an improvement in the lifespan of the population with boosted fecundity (shown in red). To get a better sense of this, let’s look at the mileposts again.
summary(cypproj_3r, milepost = c(1, 3, 5, 8, 9, 10, 12, 15, 18, 20, 100))
#>
#> The input lefkoProj object covers 1 population-patches.
#> It includes 10000 projected steps per replicate and 100 replicates.
#> The number of replicates with population size above the threshold size of 1 is as in the following matrix, with pop-patches given by column and milepost times given by row:
#>
#> 1 1
#> 1 100
#> 3 100
#> 5 100
#> 8 66
#> 9 40
#> 10 20
#> 12 11
#> 15 1
#> 18 0
#> 20 0
#> 100 0
#> NULL
summary(cypproj_3r_2, milepost = c(1, 3, 5, 8, 9, 10, 12, 15, 18, 20, 100))
#>
#> The input lefkoProj object covers 1 population-patches.
#> It includes 200 projected steps per replicate and 100 replicates.
#> The number of replicates with population size above the threshold size of 1 is as in the following matrix, with pop-patches given by column and milepost times given by row:
#>
#> 1 1
#> 1 100
#> 3 100
#> 5 100
#> 8 82
#> 9 60
#> 10 33
#> 12 10
#> 15 1
#> 18 0
#> 20 0
#> 100 0
#> NULL
Users will note little difference here, with the inference that boosting germination has no real impact on the population dynamics. It is at this point that we consider other strategies, such as boosting adult survival through other means.
We are grateful to two anonymous reviewers whose scrutiny improved the quality of this vignette. The project resulting in this package and this tutorial was funded by Grant-In-Aid 19H03298 from the Japan Society for the Promotion of Science.